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 origi
On Sunday 07 October 2007 22:32, 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'''
>
And there is even a third way:-)
>>> s = "hello " \
.
> logger.info("Checked %s records in %s seconds, yielding an average of
> \
> %s seconds per record." % (len(self.data), duration, avgquery) )
^
Remove these spaces. It makes the source code look weird, but the
output will be correct.
Alan
_
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
wormwood_3 wrote:
> Hello tutors,
>
> I am adding logging to a program I am writing. I have some messages I want to
> log that are rather long. The problem I am running into is that when the line
> is more than the 80 character line recommendation and I split it across 2
> lines with "\", the o
claxo wrote:
> dont indent the line after '\', that means 0 indent
>
> s = 'hello\
> boy'
>
Or, arguably better:
s = '''hello
boy'''
>
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
dont indent the line after '\', that means 0 indent
s = 'hello\
boy'
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Sent this almost an hour ago, did not get it from the list yet. No idea why,
but sending again...
--
Hello tutors,
I am adding logging to a program I am writing. I have some messages I want to
log that are rather long. The problem I am running into is that when the line
Hello tutors,
I am adding logging to a program I am writing. I have some messages I want to
log that are rather long. The problem I am running into is that when the line
is more than the 80 character line recommendation and I split it across 2 lines
with "\", the output is affected.
Example c