
# https://www.globalsino.com/ICs/
# Count Number of Lines in a Text File

theFile = r"C:\GlobalSino20230219\ICs\images2\YouguiLiao\Text2410a.txt"
with open(theFile, 'r') as f:
    for count, line in enumerate(f):
        pass
print('Line number in the text file is ', count)
print('Line number (including the last empty line) in the text file is ', count + 1)



