What is the fastest way to execute Python from PHP assuming that I need to pass variables to Python script and get result from it?
Asked
Active
Viewed 136 times
0
-
You could communicate between the two with a message queue. – Blender May 22 '13 at 00:09
-
not sure about fastest, but here are two ways: http://stackoverflow.com/questions/7041104/execute-python-from-php – Robin Manoli May 22 '13 at 00:09
1 Answers
2
By using the popen() function:
$result = popen('python yourscript.py ' . $args, 'r');
Konstantin Yovkov
- 60,548
- 8
- 97
- 143