Re: question about the textwrap module

2008-10-29 Thread Sion Arrowsmith
Gabriel Genellina <[EMAIL PROTECTED]> wrote: >py> text = 'This is some \t text with multiple\n\n spaces.' >py> import re >py> re.sub(r'\s+', ' ', text) >'This is some text with multiple spaces.' py> ' '.join(text.split()) 'This is some text with multiple spaces.' -- \S -- [EMAIL PRO

Re: question about the textwrap module

2008-10-28 Thread TP
Gabriel Genellina wrote: > You may pre-process your text (stripping redundant whitespace) before > using textwrap: Thanks Gabriel for your answers! I finally have subclassed textwrap.TextWrapper. Julien -- python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.9&1+,\'Z (55l4('])" "W

Re: question about the textwrap module

2008-10-27 Thread Gabriel Genellina
En Mon, 27 Oct 2008 20:50:08 -0200, TP <[EMAIL PROTECTED]> escribió: Recently, I have tried to improve the look of the printed text in command line. For this, I was compelled to remove redundant spaces in strings, because in my scripts, often the strings are spreading on several lines. For ex