'print' in a CGI app.
Patrick Lioi
patrick at novaroot.com
Sun Aug 3 17:30:02 EDT 2003
"Andrew Chalk" <achalk at XXXmagnacartasoftware.com> wrote in message news:<ERcXa.1902$W63.925904037 at newssvr30.news.prodigy.com>...
> In a Python 2.2 app. running under CGI the statements
>
> print "Hello\n"
> print "World"
>
> print both words on the same line in IE6. How do I print the second one on a
> new line (i.e. respect the \n in the first statement).
>
> Many thanks!
Run the app, then go to "View"->"Source" in the browser. $10 says
they are on separate lines. All browsers are expecting HTML output
from CGI scripts. HTML ignores whitespace. The <br> tag comes in
handy for forcing an endline:
print "Hello<br>"
print "World"
More information about the Python-list
mailing list