[Tutor] Logging with proper format
Eric Brunson
brunson at brunson.com
Mon Oct 8 16:58:21 CEST 2007
Kent Johnson wrote:
> Eric Brunson wrote:
>
>> claxo wrote:
>>
>>> dont indent the line after '\', that means 0 indent
>>>
>>> s = 'hello\
>>> boy'
>>>
>>>
>> Or, arguably better:
>>
>> s = '''hello
>> boy'''
>>
>
> That is a different string, it contains a newline, the original does not:
>
> In [20]: s = 'hello\
> ....: boy'
> In [21]: s2 = '''hello
> ....: boy'''
> In [22]: s==s2
> Out[22]: False
> In [23]: print s
> helloboy
> In [24]: print s2
> hello
> boy
>
You're right. I though he was looking to embed the newline, but I read
it wrong.
>
> Kent
>
More information about the Tutor
mailing list