I am reading a file in Python. After I read a bunch of lines, is there a convenient function that I can use to get the current line number in the file that the cursor is on?
I am trying to refrain from using a counter since I have multiple functions that read the same file and may move the cursor all over the place.
Thanks
You can go line-by-line with fileinput: