os.system

Jim Richardson warlock at eskimo.com
Mon Dec 6 23:28:49 EST 1999


On Sat, 04 Dec 99 19:49:03 GMT, 
 David Smead, in the persona of <smead at amplepower.com>,
 brought forth the following words...:

>This works in the test mode, but jeeps isn't called when executed as a
>CGI.  Any comments would be appreciated.
>
>#!/usr/bin/python
>import sys, cgi, string, os
>print "content-type: text/html"
>print
>print "<title>Python Rules!</title>"
>print "<body><br>"
>sys.stdout.write('who done it?')	# no \n at the end
>print "junk"
>
>os.system("jeeps")	#doesn't get called when CGI
>
>print "</body>"
>print "</html>"
>if __name__=="__main__": cgi.test()
>
>-------		here's the script called jeeps
>
>#!/bin/sh
>date > jnkdate
>
I don't have the solution, but I do know (at least I _think_ I
know) the problem. The return value of the os.system call, is the
error if any of the function, if jeeps runs fine with no returned
error, then the value of return to os.system is either null or 0.
 Hope someone has the solution, 'cause I am trying to write a
 simple "click here for a fortune" cgi to help me in the learning
of how to type and chew gum at the same time. 
-- 
Jim Richardson
	Anarchist, pagan and proud of it
WWW.eskimo.com/~warlock
	Linux, because life's too short for a buggy OS.




More information about the Python-list mailing list