heredoc and variables

flupke flupke at nonexistingdomain.com
Sat Jun 5 04:33:34 CEST 2004


Peter Otten wrote:
> flupke wrote:
>
>> 2) Consider following heredoc
>>
>> end_html="""</BODY>
>> </HTML>"""
>>
>> I have to write it like this to avoid having an empty line added
>> above AND below the actual string when using it.
>
> Why would you care about whitespace in HTML?

For the same reason i care about nicely spaced code. To make
it readable. I do not use any HTML editor so i want the html code
to be clean and easily readable.

>>>> print """\
> ... here's how \
> ... to escape \
> ... newlines"""
> here's how to escape newlines
>>>>
>
> Peter

Thanks





More information about the Python-list mailing list