[Tutor] pstree cgi-script
gubbs at fudo.org
Tue Jun 15 21:23:03 EDT 2004
I'm trying to write a simple little cgi-script that executes pstree and
echos/prints the output to the webpage ..
Clearly I am doing it wrong, as it will not work.
Here's my code:
cmd = "pstree"
status = os.system(cmd)
print "Status:", status
When I run it .. I get the following error from Apache:
[Wed Jun 16 01:18:14 2004] [error] [client 188.8.131.52] malformed
header from script. Bad header=init-+-5*[agetty]: hello.py
When run from the python intepreter its clearly working:
[drachenfels][~/Desktop]$ python hello.py
I suspect there's something wrong with the way I am outputting .. as the
first line of the program's output is being fed directly to apache by
the looks of it, which is righlty getting very confused.
How can I make this work out?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/tutor/attachments/20040616/156859a4/attachment.bin
More information about the Tutor