f = open(filename)
lines = f.readlines()
f.close()
print "%s has %d lines." % (filename, len(lines))
Showing posts with label files. Show all posts
Showing posts with label files. Show all posts
Tuesday, April 10, 2007
Counting number of lines in a file @ python
Subscribe to:
Posts (Atom)