Coming from Perl

Ben Finney bignose+hates-spam at benfinney.id.au
Thu Sep 13 02:44:28 CEST 2007


Amer Neely <perl4hire at softouch.on.ca> writes:

> A question I have, if someone here is familiar with Perl, does Python
> have something like Perl's 'here document'?

I'm not sure exactly what behaviour you want, but Python accepts
literal strings to be triple-quoted (i.e. delimited by """ pairs or
''' pairs), which allows you to freely use literal line feed and quote
characters inside that string.

    <URL:http://docs.python.org/ref/strings.html>

-- 
 \     "Are you pondering what I'm pondering?" "I think so, Brain, but |
  `\    pants with horizontal stripes make me look chubby."  -- _Pinky |
_o__)                                                   and The Brain_ |
Ben Finney



More information about the Python-list mailing list