Re: multiline strings and proper indentation/alignment

2006-05-10 Thread Dave Hansen
On Wed, 10 May 2006 15:50:38 GMT in comp.lang.python, John Salerno <[EMAIL PROTECTED]> wrote: >Dave Hansen wrote: > > print textwrap.dedent(s).strip().replace('\n',' ') >> this is a multiline triple-quted string with indentation for nicer >> code formatting > >But I have some newlines that are

Re: multiline strings and proper indentation/alignment

2006-05-10 Thread John Salerno
Dave Hansen wrote: print textwrap.dedent(s).strip().replace('\n',' ') > this is a multiline triple-quted string with indentation for nicer > code formatting But I have some newlines that are already embedded in the string, and I wouldn't want those replaced. -- http://mail.python.org/mailm

Re: multiline strings and proper indentation/alignment

2006-05-10 Thread Dave Hansen
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

Re: multiline strings and proper indentation/alignment

2006-05-10 Thread John Salerno
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. Abou

Re: multiline strings and proper indentation/alignment

2006-05-10 Thread bruno at modulix
John Salerno wrote: > Gary Herron wrote: > >> Gary John Salerno wrote: >> >>> How do you make a single string span multiple lines, but also allow >>> yourself to indent the second (third, etc.) lines so that it lines up >>> where you want it, without causing the newlines and tabs or spaces to >>>

Re: multiline strings and proper indentation/alignment

2006-05-09 Thread John Salerno
Gary Herron wrote: > Gary John Salerno wrote: > >> How do you make a single string span multiple lines, but also allow >> yourself to indent the second (third, etc.) lines so that it lines up >> where you want it, without causing the newlines and tabs or spaces to be >> added to the string as w

Re: multiline strings and proper indentation/alignment

2006-05-09 Thread Gary Herron
Gary John Salerno wrote: >How do you make a single string span multiple lines, but also allow >yourself to indent the second (third, etc.) lines so that it lines up >where you want it, without causing the newlines and tabs or spaces to be >added to the string as well? > >Example (pretend this i

Re: multiline strings and proper indentation/alignment

2006-05-09 Thread John Salerno
Scott David Daniels wrote: > John Salerno wrote: >> How do you make a single string span multiple lines, but also allow >> yourself to indent the second ... without causing the newlines and >> tabs or spaces to be added to the string as well? > > >> self.DTD = '''>"http://www.w3.org/

Re: multiline strings and proper indentation/alignment

2006-05-09 Thread Scott David Daniels
John Salerno wrote: > How do you make a single string span multiple lines, but also allow > yourself to indent the second ... without causing the newlines and > tabs or spaces to be added to the string as well? > > self.DTD = '''"http://www.w3.org/TR/html4/strict.dtd";>\n\n''' > > .

Re: multiline strings and proper indentation/alignment

2006-05-09 Thread Christoph Haas
On Tue, May 09, 2006 at 05:38:52PM +, John Salerno wrote: > How do you make a single string span multiple lines, but also allow > yourself to indent the second (third, etc.) lines so that it lines up > where you want it, without causing the newlines and tabs or spaces to be > added to the st