Re: file.readlines() question

2005-07-09 Thread vch
Erik Max Francis wrote: > ... modern versions of > Python allow iteration over a file, which will read it line by line: > > for line in aFile: > ... > Thanks! Just what I need. -- http://mail.python.org/mailman/listinfo/python-list

Re: file.readlines() question

2005-07-09 Thread Erik Max Francis
vch wrote: > Does a call to file.readlines() reads all lines at once in the memory? > Are the any reasons, from the performance point of view, to prefer > *while* loop with readline() to *for* loop with readlines()? Yes, and you just mentioned it. .readlines reads the entire file into memory