General question re: print statement

chibaA at TinterlogD.Tcom chibaA at TinterlogD.Tcom
Tue May 9 12:34:00 EDT 2000


I'm trying to use python for html pages - and I was curious if there
was a way to do a large output of text using print.  Confused?  Here's
an example.

In Perl, you can use the following snippet of code to output HTML:

print <<"(BLOCK OF CODE)";

  Content-type: text/html

  <html>
   <head>
    <title>

      .....

  </html>
(BLOCK OF CODE)

The basic point of this code above - is the print<<"(WHATEVER)"; part
of it --> whatever is between the (WHATEVER)s, can be free form text
which will just be outputted as is (with the spaces, new lines, etc).
And I don't have to use escape characters to output reserved
characters.

Does anyone know if this is possible - or how to do this in Python?

Thanks in advance,

kc




More information about the Python-list mailing list