CGI Script using Python

Michael Ströder michael.stroeder at inka.de
Mon Jan 3 19:34:35 EST 2000


"Paul E. Bible" wrote:
> 
>     print "Content-type: text/html\n\n"
                                      ^^
One too much.

> [..]
> The Apache error log indicates a 'Premature end of script headers:
> /usr/local/apache/cgi-bin/test.py'.

The print statement already sends one \n.

Should be

  print "Content-type: text/html\n"

to print exactly one single empty line between HTTP header and HTML
data. Like this:
-----------
Content-type: text/html

<HTML>
-----------

Ciao, Michael.



More information about the Python-list mailing list