Running os.system from browser
guettli at thomas-guettler.de
Tue Jul 13 15:47:33 CEST 2004
Am Mon, 12 Jul 2004 18:25:07 -0700 schrieb Sean Berry:
> I have a python program that I want to
> be able to run from a browser window.
> I have the following as the first few lines
> of a program.
> import os
> print "Content-Type: text/html\n"
> The program also works from the command
> line. How can I fix this problem?
os.system() writes to stdout. This means if your
programm.py write to stdout it is send to the browser.
Use os.system('.. >> logfile 2>&1') or popen4
Thomas Güttler, http://www.thomas-guettler.de/
More information about the Python-list