On Wed, 10 May 2006 13:56:52 GMT in comp.lang.python, John Salerno <[EMAIL PROTECTED]> wrote:
>bruno at modulix wrote: > >> Why not trying by yourself ?-) > >Doh! I always forget I can do this! :) > > >> Mmm. Not good. Let's try again: >>>>> print textwrap.dedent(s).strip() >> this is a multiline >> triple-quted string with >> indentation for nicer code formatting >> >> Well, seems like we're done. About 2'30'' to solve the problem. > >Actually, I'm still wondering if it's possible to remove the newlines at >the end of the first and second lines (after 'multiline' and 'with'), so Well, it's too long for my news reader to display the result on a single line, but: >>> print textwrap.dedent(s).strip().replace('\n',' ') this is a multiline triple-quted string with indentation for nicer code formatting >>> >that the string is one line. But it's already been shown that textwrap >alone doesn't do this, so I'd rather not mess with all the extra stuff >to do it, when I can just put the string in parentheses. If that's the way you want the sting in the first place, that'd be my recommendation. Regards, -=Dave -- Change is inevitable, progress is not. -- http://mail.python.org/mailman/listinfo/python-list