Executing a python script from within perl
| From: | Anuj Bhatt | Date: | Wed, 23 Jul 2008 03:09:16 +0000 |
| Subject: | Executing a python script from within perl | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-19192@lists.php.net to get a copy of this message | ||
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