Running os.system from browser

Tim Daneliuk tundra at
Tue Jul 13 04:40:11 CEST 2004

Sean Berry wrote:

> I have a python program that I want to
> be able to run from a browser window.
> It gets run in a cron job every day, but
> I want my boss to be able to run it whenever
> he wants to since the database it uses is
> updated many times throughout the day.
> I have the following as the first few lines
> of a program.
> #!/usr/local/bin/python
> import os
> os.system('/path/to/my/')
> print "Content-Type: text/html\n"
> The rest of the program just spits out some
> simple html.  Ths os.system call is what is
> breaking the program when I run it from a
> browser, because I have commented it out
> and the program works.
> The program also works from the command
> line.  How can I fix this problem?
> Thanks for any help.

At first glance, this suggests itself:

    os.system('/path/to/python /path/to/my/')

Tim Daneliuk     tundra at
PGP Key:

More information about the Python-list mailing list