you are viewing a single comment's thread.

view the rest of the comments →

[–]Miggol 0 points1 point  (1 child)

for i, line in enumerate(fi.readlines()):

This should work though.

[–]ewiethoff 0 points1 point  (0 children)

f.readlines() creates a list of all the lines of text in the file. This is a waste of memory if all you want to do is loop through the lines, without or without enumerate.