Coding Monkey
Sunday, September 26, 2010
count line without linespace
def countLineInFile():
f=open('./filename.txt')
line = f.readline()
lineNumber = 0
while line != "":
line = f.readline()
lineNumber = lineNumber + 1
f.close()
return lineNumber
No comments:
Post a Comment
Newer Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment