printing python script execution inside php

printing python script execution inside php

am 23.10.2007 11:04:47 von sami

Hi

Is it possible to print the output of a Python script inside PHP? e.g.
I have a python script that has the contens:

pyScript.py:

#!/usr/bin/python
print "hello world"

and I have a PHP script phpScript.php:


-- Execute pyScript.py here and print its output to stdout ("hello
world") here

?>

I found PiP but that is for embedding Python code inside PHP

Thanks

Sami

Re: printing python script execution inside php

am 23.10.2007 13:15:37 von tynril

On 23 oct, 11:04, sami wrote:
> Hi
>
> Is it possible to print the output of a Python script inside PHP? e.g.
> I have a python script that has the contens:
>
> pyScript.py:
>
> #!/usr/bin/python
> print "hello world"
>
> and I have a PHP script phpScript.php:
>
> >
> -- Execute pyScript.py here and print its output to stdout ("hello
> world") here
>
> ?>
>
> I found PiP but that is for embedding Python code inside PHP
>
> Thanks
>
> Sami

Hi Sami,

You can do it by using the exec function (http://www.php.net/manual/en/
function.exec.php).