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
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
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
Hi everybody,
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 example, "aaa bbb" had to be transformed in "aaa bbb".
I ha