I want to include the following python code into php. The name of the python file is hello.py. The contents are print "Hello World" I want to call this python script in php and show the same in webpage
Asked
Active
Viewed 51 times
0
-
1possible duplicate of [Running a python script from PHP](http://stackoverflow.com/questions/19735250/running-a-python-script-from-php) – Konstantin Apr 29 '15 at 15:40
-
http://stackoverflow.com/questions/166944/calling-python-in-php – Sagar Naliyapara Apr 29 '15 at 15:41
1 Answers
0
Not really possible like that. What you could do is use exec
or passthru
to run the python in the terminal and return the results. Best option would be to do a separate call to the python script and combine them on the client.

Kevin Nagurski
- 1,889
- 11
- 24