How to read space separated file in python?
steve at holdenweb.com
Sat Nov 22 00:40:59 CET 2008
Joe Strout wrote:
> Partition handles these cases correctly (at least, within the OP's
> specification that the value of "b" should be whatever comes after the
> first space).
I believe if you read the OP's post again you will see that he specified
two non-space items per line.
You really *love* being right, don't you? ;-) You say partition "...
better encodes the intention, which is to split only on the first space
in the line, rather than on every space". Your mind-reading abilities
are clearly superior to mine.
Anyway, sorry to have told you something you already knew. It's true
that partition has its place, and is too often overlooked. Particularly
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
More information about the Python-list