Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to count the lines of code using open in python

# open file in read mode
with open(r"E:demosfiles
ead_demo.txt", 'r') as fp:
    for count, line in enumerate(fp):
        pass
print('Total Lines', count + 1)
Source by pynative.com #
 
PREVIOUS NEXT
Tagged: #count #lines #code #open #python
ADD COMMENT
Topic
Name
5+8 =