On Wed, 22 Sep 2004 19:48:21 GMT, Andrew Dalke <adalke at mindspring.com> wrote: >Bengt Richter wrote: >> or, if you _are_ willing to read in the whole file, >> >> open('text.txt').read().count('\n') > >Except the last line might not have a terminal newline. > I _knew_ I should have mentioned that ;-) Regards, Bengt Richter