Link to home
Start Free TrialLog in
Avatar of m_mccabe
m_mccabeFlag for United States of America

asked on

Python "os.system" calls using IIS6

I am executing a python script on a web server running Windows 2003, IIS6, and FastCGI.  I have have my web extensions all set up, and most python scripts run just fine from the browser.  It's only when I try to make "os.system" calls that things fail.

I have a script here that runs fine from command line and generates textfile.  When run from a web browser however, this does not work:
---------------------
import os
os.system('touch output.txt')
os.system('echo 1 >> output.txt')
---------------------

I have seen several others ask this same question all over the web since 2001, but no one ever seems to get a real answer.  Does anyone know why this does not work in IIS?  More importantly, does anyone know how to make this work in IIS?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of cj_1969
cj_1969
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of m_mccabe

ASKER

Thanks a ton, cj_1969!  I tried your solution and it worked.  During this process, it also got me thinking about permissions, and in the end I only needed to grant the IUSR_%computername% account access to python.exe and cmd.exe.

Thanks so much for getting me on the right track.