In my php script I've run the following
//PHP script to send json data to python
$t = new test();
$t->testname1 = $testname;
$t->jmx1=$jmx;
#$jsondata=json_encode($t);
$output=shell_exec('python /var/www/metro/run.py' . escapeshellarg(json_encode($jsondata)) );
Example of the json output as the following
"{"testname1":"fairul","jmx1":"1562638904.jmx"}"
I would like to use json.loads from the argument argv1 above in order to access it in python..
import sys, json
# Load the data that PHP sent us
try:
data = json.loads(sys.argv[1])
except:
result = data['testname1']
# Send it to stdout (to PHP)
print json.dumps(result)
Not sure why i could only get NULL output
data?