Executing a python script from within perl

[email protected] (Anuj Bhatt)
Newsgroups php.install
Message-ID <1216782556.12282.10.camel@slackbot>
Hi,


I'm new to PHP and just installed apache2 with php support. I'm trying
to execute a Python script (from within php), which does take a good
amount of time and am waiting for it to terminate so that I can process
the output and print that out in HTML.

The problem I'm having is that I can't get the PHP script to wait for
the Python file to terminate. If I try it with a simple Python script
say "print Hello, World!" it gets that. But anything that takes
substantially long time, it just returns. I've tried system("myfile.py",
$result) and $result results in a 1 and prints any subsequent prints in
the PHP file. I also tried exec, with no luck. I've read through
http://www.php.net/function.exec and the documentation presented in the
"See Also" section with other commands. I haven't got anywhere yet,
after much work. Any pointers, suggestions and fixes?


-anuj
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.