On 10/10/2007, Eli Brosh <[EMAIL PROTECTED]> wrote:
>
>
> Hello
> I have a multiline string such as:
> s='''This is the first line
> This is the second line
> This is the third longer line'''
>
> Note that s has no control character such as \n.

Did you check that?

>>> s = '''This is the first line.
... This is the second line.
... This is the third longer line.'''
>>> print s
This is the first line.
This is the second line.
This is the third londer line.
>>> print repr(s)
'This is the first line.\nThis is the second line.\nThis is the third
longer line.'

A multiline string has newline characters by definition.  You can
split the string around them by using s.split():

>>> s.split('\n')
['This is the first line.', 'This is the second line.', 'This is the
third longer line.']

HTH!

-- 
John.
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to