PHP Embedded In Python

jdonnell jaydonnell at gmail.com
Tue Feb 8 16:44:48 EST 2005


Well it depends on how php is installed. Is it a linux system? Do you
know how to run a php script from the command line?

Once you have the php script running from the command line then you
need to use the os module in python. There are a couple different ways
to do it. Read the following for more info.
http://docs.python.org/lib/os-process.html
http://docs.python.org/lib/os-newstreams.html#os-newstreams

simple example:

import os
handle = os.popen('path/to/yourScript.php', 'r')
print handle.read()




More information about the Python-list mailing list