problems with exec php

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 the content formed in json

    {
       "algumacoisa":"algumacoisa"
    }

When I do this from the command prompt:

    python.exe programa.py

It returns the content correctly, but when I do it with php

    php site.php

It only returns the last line of json which is just one

    }
    
asked by anonymous 05.12.2016 / 00:53

1 answer

0

Resolved

It worked fine using the command

    passthru($comando, $resultado); echo $resultado;
    
05.12.2016 / 03:57