How to execute Python script through php under Windows10 -


i have spent lot of time looking how can run python script in php reason not work. have got login page , once press button "login", should direct next php page, has execute python script.

python:

#!c:/python36/python.exe import csv import cgi, cgitb import sys   data = {i[0]:i[1:] in csv.reader(open('students.csv'))}  name = input("please provide name: ") subject = input("please provide subject: ")  if subject in data[name]:    print("you registered") else:     print("you not registered") 

php:

<?php  $result = shell_exec('studmatch.py'); echo "$result"; ?> 

i using free web hosting webfreehosting.net

thank you.

you need shell_exec('python studmatch.py') might need full python path if it's not in regular path environment variable.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -