Pass php variables values to python script

Assume the following php code:


$var1 = "1";
$var2 = "2";
$var3 = "3";
$output = exec(" ".$var1." ".$var2." ".$var3);
print $output;


$output variable contains python's script output

Then we have to create the script. 

import sys

print sys.argv[1], sys.argv[2], sys.argv[3] 


Popular posts from this blog

Vertex Cover (python implementation)

Transportation Problem (Vogel algorithm python)

IP scanning in python