Turn off line wrap for lists?

_ webb.sprague at gmail.com
Thu Jan 4 20:01:03 EST 2007


(I did google for this, I promise)

How do I get python NOT to insert newlines into string representations
of lists when I do something like this:

strCollector += "%s" % (['a', 'list', 'with', 'lots', 'of', 'elements']
* 100)

?

I would like to set a default never to do this, if possible. (Never mix
formatting with display, or tequila with bourbon -- bad, bad, bad!)

FYI I am using this to export data into tab delimited format, so the
lines can be as long as they need to be, but a newline means a new
record.

FYI (2), this is in web application too, so I am afraid I might have to
set the default in a bunch of different modules.

TIA




More information about the Python-list mailing list