[Tutor] Problem Passing VARs to Python from PHP & capturing return string

bob gailer bgailer at gmail.com
Fri Oct 22 21:13:13 CEST 2010

On 10/22/2010 2:52 PM, Roy Hinkelman wrote:
> My script doesn't want to recognize the variables from the exec() 
> command in PHP. Plus, it won't capture the results of the script.

This is a pretty vague description of the problem. Please provide 
explicit details.
> This Python script works in IDLE, and I've got some testing code in there.
> One Known Unsolved Issue:
> I put Python in C:\Program Files\Python26\python.exe and have tried
> $command = "C:\Program Files\Python26\python.exe 
> include/weatherFeed.py -c $city -s $state";
> to no avail.
The full path to Python must be in quotes (due to the space in the 
path). I don't know enough Perl to tell you how to do this.

In Python I would:
command = '"C:\Program Files\Python26\python.exe" include/weatherFeed.py 
-c %s -s %s' % (city, state)


Bob Gailer
Chapel Hill NC

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101022/de385219/attachment.html>

More information about the Tutor mailing list