readlines() problem, more info
Steve Holden
sholden at holdenweb.com
Mon Apr 1 18:33:16 EST 2002
More information about the Python-list mailing list
Mon Apr 1 18:33:16 EST 2002
- Previous message (by thread): readlines() problem, more info
- Next message (by thread): GUI programming
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"John Purser" <NO_SPAM_jmpurser2 at attbi.com> wrote in message news:nd2q8.149996$ZR2.64791 at rwcrnsc52.ops.asp.att.net... > Hello, > > I've got a little function: > > def FindLine(Record): > im1_Dif.seek(0) > temp = im1_Dif.readlines(Record) > lngCount = 0L > for line in temp: > print str(lngCount), ' ', line > lngCount += 1 > test = im1_Dif.readline() > print test > > That I'm using to trouble shoot a small script. When I run this in the > interactive mode it returns 136 lines to "temp" no matter what number I pass > to it. Can anyone tell me why this is happening? > > I'm using Python 2.2 on Windows 2000. > So am I. >>> import sys >>> print sys.stdin.readlines.__doc__ Read until EOF using readline() and return a list containing the lines thus read. If the optional sizehint argument is present, instead of reading up to EOF, whole lines totalling approximately sizehint bytes (possibly after rounding up to an internal buffer size) are read. I suspect you are seeing the rounding up takinhg place. regards Steve
- Previous message (by thread): readlines() problem, more info
- Next message (by thread): GUI programming
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list