"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> The error you get is NOT a syntax error: > > >>> cmd = '%s format %s \ > ... over %d lines' % ('my', 'string', 2) > >>> cmd > 'my format string over 2 lines' > >>> > > The interpreter is probably complaining because it needs six values to > fill out the format and you only provided four. Also, I'm dubious about the idea of splitting a string literal across multiple lines, as it's impossible to indent such a literal nicely without putting stray spaces into its contents. So instead of writing 'this is a\ long string' and not making it clear how many spaces you intend between 'a' and 'long', how about writing this instead? ('this is a ' 'long string') in which the contents are not in doubt. This code takes advantage of two properties of Python: 1) Multiple string literals with only whitespace between them are automatically concatenated; 2) Ending a line inside unbalanced parentheses implicitly makes the next line part of the same statement. -- http://mail.python.org/mailman/listinfo/python-list