Difference between plain print, and print with format string?

Chris Stromberger bit_bucket5 at hotmail.com
Fri Jan 25 20:47:36 EST 2002


On Fri, 18 Jan 2002 11:04:23 +0200, Joonas Paalasmaa <joonas at olen.to>
wrote:

>Chris wrote:
>> 
>> Joonas Paalasmaa <joonas at olen.to> wrote in message news:<3C46BE61.22E21BFD at olen.to>...
>> > Chris wrote:
>> > >
>> > > I noticed that in my python cgi script, the following comes up in
>> > > Netscape 4.7 as plain text:
>> > >
>> > > --------------------
>> > > def htmlHeader():
>> > >   return "Content-type: text/html\n"
>> > >
>> > > ...
>> > >
>> > > print htmlHeader()
>> > >
>> > > print <html tags and stuff here...>
>> > > ----------------------
>> > >
>> > > This works in IE 5.5, but just dumps the plain html in Netscape 4.7.
>> > > Choosing View | Page Info shows the "File MIME Type", according to
>> > > Netscape, as "text/plain".  Changing the line above to the following
>> > > fixes the Netscape issue:
>> > >
>> > > print "%s" % htmlHeader()
>> > >
>> > > So, what's going on here?  What's the difference?
>> >
>> > There souldn't be any difference.
>> > Can you give the URL of that example or is it on your local computer.
>> 
>> It's purely local code.  Very odd.
>
>The thuth is, that there is no dufference between those examples.
>Try to run the script from the command-line and examine its output.

You would think so, but Netscape doesn't.




More information about the Python-list mailing list