Hot to split string literals that will across two or more lines ?

Tony Nelson *firstname*nlsnews at georgea*lastname*.com
Thu Nov 17 23:19:45 EST 2005


In article <1132284614.326121.252250 at g49g2000cwa.googlegroups.com>,
 "Sam Pointon" <free.condiments at gmail.com> wrote:

> > print "a string which is very loooooo" \
> > 	+ "ooooong."
> 
> Minor pedantry, but the plus sign is redundant. Python automatically
> concatenates string literals on the same logical line separated by only
> whitespace.
> 

While we're at it, I use bracketing instead of line continuation:

    print ( "a long string, longer than this "
            "and some more of the string" )
________________________________________________________________________
TonyN.:'                        *firstname*nlsnews at georgea*lastname*.com
      '                                  <http://www.georgeanelson.com/>



More information about the Python-list mailing list