0
I made the following command in php
$comando="C:\Python27\python.exe programa.py";
echo $comando;
in the python file
print resultado;
This result variable has content formed in json
{
"algumacoisa":"algumacoisa"
}
When I do the command prompt:
python.exe programa.py
It returns the contents correctly, but when I do with php
php site.php
It only returns the last line of json which is only one
}
I’m not very knowledgeable about exec php, but you tried with shell_exec?
– Leo Letto
shell_exec is for linux
– Mega Anim
I use shell_exec in windows, if you’re using php you probably can too
– Leo Letto
I figured it out, just using the passthru
– Mega Anim
passthru($command, $result); echo $result;
– Mega Anim
where I put that’s solved?
– Mega Anim
only leaves so, or else answers your own question with the answer you found and marks your answer as the correct one
– Leo Letto