[Tutor] Stuck on Something

Michael P. Reilly arcege@shore.net
Wed, 7 Mar 2001 07:27:20 -0500 (EST)


> 
> >This looks reasonable.  However, I did a quick check on my system, but I
> >couldn't find string.splitlines().  Do you mean:
> >
> >     string.split(some_large_string, '\n')
> >
> >instead?  This should break your string into lists of lines.
> 
> Hmm, interesting. I have a copy of Core Python Programming by Wesley Chun 
> right here, and it lists string.splitlines() as a string function. But when 
> I check on the Python website, all I see is string.split(). Odd.

There is a function called "splitfields".  In Python 1.5.2, the
string.split was changed to have the same (extended) functionality as
string.splitfields.   Splitfields() may possibly be deprecated in the
future, and it is better to use split().

What you might be thinking of is the new Python 2.0 string methods
where there is a `"".splitlines()', instead of the functions in the
"string" module.  It is basically the equivalent of
`string.splitfields("", os.linesep)'.

  -Arcege

-- 
------------------------------------------------------------------------
| Michael P. Reilly, Release Manager  | Email: arcege@shore.net        |
| Salem, Mass. USA  01970             |                                |
------------------------------------------------------------------------