I need to run a python program with command line argument from my php script
This is my code
<?php
$output=shell_exec('python /path/to/python_from_php.py input1 input2');
echo $output;
?>
I am getting the contents inside shell_exec function as the output. I tried using only
$output=exec('python /path/to/python_from_php.py input1 input2');
I am getting only the second input as my output. But what I want is I should be able to print the input contents through my python script. If I remove the "echo $output" line I am not getting any output. My python code
import sys
a=(sys.argv)
for i in (sys.argv):
print i