Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python number of lines in file

num_lines = sum(1 for line in open('myfile.txt'))

# Notice: Problem with this solution is that it won't
# 		  count empty line if it is at end of file.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #number #lines #file
ADD COMMENT
Topic
Name
4+5 =