Skip to content

Instantly share code, notes, and snippets.

@russelnickson
Created January 14, 2010 10:13
Show Gist options
  • Save russelnickson/277032 to your computer and use it in GitHub Desktop.
Save russelnickson/277032 to your computer and use it in GitHub Desktop.
Count lines
import sys
from string import split
f=open(sys.argv[1])
content=f.read()
print content
print 'the no.of lines in file = '+ str(len(split(content,'\n')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment