views:

87

answers:

2
A: 

Try renaming the .py files to .cgi, it worked for me.

sp
I've just tried that. It didn't work..
David
A: 

Is it missing a content-type header?

#!/usr/bin/python

print "Content-Type: text/plain\n"
print "Hello World!"
sberry2A
actually this is way wrong, there is no HTML in your example. It should be "Content-Type: text/plain\r\n"
fuzzy lollipop
The point is that there should be a content-type header. Modified to suit you.
sberry2A
Technically, `\r\n` should be used for newlines (so `sys.stdout.write('Content-Type: text/plain\r\n\r\nHello world!')` would be right). But browsers do accept the `\n` version too.
bobince