On Fri, 18 Nov 2005 11:33:57 +0800, Xiao Jianfeng <[EMAIL PROTECTED]> wrote:
>Lars Kellogg-Stedman wrote: > >>>print "a string whcih is very very looooooooooooooooooooooooooooooooooo\ >>>oooooooooooooooooooong." >>> >>> >> >>print "a string which is very loooooo" \ >> + "ooooong." >> Personally, I prefer to use a parenthesized expression format instead of "\" and (as has been mentioned) to remove the '+' between adjacent string literals, since the tokenizer will join adjacent string literals into one to generate a single constant. This is more efficient at run time also, since there are no byte codes generated for the adding. E.g., the above becomes print ("a string which is very loooooo" "ooooong.") or formatted however you please. Sometimes if the substring source code is machine generated, it is handy to bracket the substrings between a header line and a trailer line, e.g., print ( "a string which is very loooooo" "ooooong." ) Regards, Bengt Richter -- http://mail.python.org/mailman/listinfo/python-list