In article <[EMAIL PROTECTED]>,
 "Simon Forman" <[EMAIL PROTECTED]> wrote:
 ...
> Python also concatenates adjacent strings, but the "real" newlines
> between your strings will need to be escaped (otherwise, because the
> newlines are statement separators, you will have one print statement
> followed by string literals with the wrong indentation.)
> 
> print "Usage: blah blah blah\n" \
>       "Some more lines in the usage text\n" \
>       "Some more lines here too."
> 
> (Note that the final string literal newline is not needed since print
> will add one of it's own.)

One can also use parentheses:

print ( "Usage: blah blah blah\n"
        "Some more lines in the usage text\n"
        "Some more lines here too." )

The newlines in the string are still needed, but the ones escaping the 
EOLs are not.
________________________________________________________________________
TonyN.:'                        [EMAIL PROTECTED]
      '                                  <http://www.georgeanelson.com/>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to