Newbie CGI problem

aurora aurora00 at gmail.com
Fri Feb 18 12:16:59 EST 2005


Not sure about the repeated hi. But you are supposed to use \r\n\r\n, not  
just \n\n according to the HTTP specification.

> #!/usr/bin/python
> import cgi
> print "Content-type: text/html\n\n"
> print "hi"
>
> Gives me the following in my browser:
>
> '''
> hi
> Content-type: text/html
>
>
> hi
> '''
>
> Why are there two 'hi's?
>
> Thanks,
> Rory




More information about the Python-list mailing list