'print' in a CGI app.

Andrew Clover and-google at doxdesk.com
Sun Aug 3 18:05:07 EDT 2003


"Andrew Chalk" <achalk at XXXmagnacartasoftware.com> wrote:

> print "Hello\n"
> print "World"

> print both words on the same line in IE6.

This is because IE is treating the page as HTML by default, where
whitespace is not significant. If this is not what you want, set the
'Content-Type' HTTP header to something else, eg.:

  #!/usr/bin/python

  print 'Content-Type: text/plain; charset=utf-8'
  print

  print 'Hello'
  print 'World'

-- 
Andrew Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/




More information about the Python-list mailing list