On Tue, 22 Nov 2005 18:38:15 +0000 in comp.lang.python, Steve Holden
<[EMAIL PROTECTED]> wrote:

[...]
>
>Of course there's also the alternative of escaping the newlines out in 
>the literal. The replace result above is exactly
>
>"""\
>lots of text hundreds of characters long\
>more text on another line but we really don't want any line breaks\
>in our final string\
>so we replace newlines in this multiline string\
>with an empty string thus\
>"""

>>> """\
That's pretty close, but\
if you don't include spaces at the ends of words\
then Python will run those words\
together, which is probably not what you want."""
"That's pretty close, butif you don't include spaces at the ends of
wordsthen Python will run those wordstogether, which is probably not
what you want."
>>> """\
So you need to add spaces, but make sure they're \
before the backslash, and not after."""
"So you need to add spaces, but make sure they're before the
backslash, and not after."
>>> 

Regards,
                                        -=Dave

-- 
Change is inevitable, progress is not.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to