Storing lines from a text file

Kirk McDonald mooquack at suad.org
Sun Jan 29 18:17:41 EST 2006


bradfordh at gmail.com wrote:
> so this:
>     a, b, c, d, e =f.readlines()
> 
> ..this will put the first line in a, second in b, etc? How do I
> accomplish this when I'm not sure how many lines there are going to be
> every time? Thanks.
> 

With a list:
http://python.org/doc/2.4.2/tut/node5.html#SECTION005140000000000000000

-Kirk McDonald



More information about the Python-list mailing list