I want to run a python file from my php code using exec
function. To do so I use command "python test.py"
and if I print "Hello World", it is showing.
For this my php code is like this:
<?php
$Data = exec("python test.py");
echo $Data;
?>
And the python code is:
print("Hello World")
Now I want to pass an input value say my name "Razin" to the file. So that it will print "Hello Razin"
.
Here is my python code
x = input()
print ("Hello "+x)
which should print Hello Razin
. And from php I catch it.
I don't want to pass arguments and use python system
to catch that. I want to make it like code judge system.
I hear about pipe and I read it. But it didn't clear my concept.
N.B: If you can also describe if there is more than 1 input then it'll be a great help.