Python CGI programming

Jay O'Connor joconnor at
Fri Feb 2 00:49:21 CET 2001

seung-won hwang wrote:
> FYI, when I type the following example, web browser just shows
> the source code..not the test string... How can I fix this?
> #!/usr/bin/python
> # Tell the browser how to render the text
> print "Content-Type: text/plain\n\n"
> print "Hello, Python!"  # print a test string

Make sure that 

a) the script is in the cgi-bin directory for the web server.  If it's
not, the server will display the file rather than execute it
b) the script has execute permission set (although I think this raises a
500 error instead)

Take care,

Jay O'Connor
joconnor at

"God himself plays the bass strings first when He tunes the soul"

More information about the Python-list mailing list