Counting lines in a file

Wednesday, Dec 26, 2007

This should do it:

print 'Line count: %s' % len(open(file).readlines())