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
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
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
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
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
>>>
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
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
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/
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'''
>
> .
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
10 matches
Mail list logo