python how to count the lines in a file
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
You must login to ask question.
with open(r"E:\demos\files\read_demo.txt", 'r') as fp: x = len(fp.readlines()) print('Total lines:', x)