[Tutor] here documents

Michael Powe michael at trollope.org
Mon Jan 3 23:54:52 CET 2005


Hello,

In perl, I create variables of fairly involved text using here
documents.  For example,

$msg = <<"EOF";
  a bunch of text here.
  ...
EOF

Is there an equivalent method in python?  I usually use this method
when creating help messages for scripts -- put all the text into a
variable and the 'print $msg' for the output.  I find it an easy way
to produce formatted text.

Now, I'm trying to switch over to python and want to recreate or adapt
my processes.

Thanks.

mp


More information about the Tutor mailing list