I have a little issue with a python script, the script getdata from some web socket, getting Json value, the result is send to a php script using os.system like that :
os.system('echo \' '+ result +' \' | php sort.php')
but the result is echoed and not piped to the php script
for debug purpose the php script only do that :
$input = readfile("php://stdin");
$data = json_decode($input, true);
var_dump($data['input']);
any idea where the issue can come from ?
PS : result is a pure json string like this one :
{
"error_code": 250,
"user": {
"id": "1",
"login": "Talus",
"password": "",
"email": "",
"display_name": ""
},
"session": {
"id": "6",
"user_owner": "1",
"token": "3MJ9G53U3292DA4217ECCC201CE06D0B0AB0B5941580BA54",
"last_activity": "2016-02-16 11:59:02",
"in_game": "0"
}
}
subprocess... (as the documentation foros.systemsuggests)