TextWrapper keepking line breaks?

js ebgssth at gmail.com
Mon Mar 10 19:31:07 EDT 2008


Hi list,

Can I make TextWrapper keep line breaks in the text?

For example,

>>> s = "spam\nham"
>>> print wrap(s)
spam
ham

As far as I can tell, there seems no way to do this,
but before writing my own solution, I want to know whether
the solution already exists or not.

Thanks.



More information about the Python-list mailing list