Using “readlines()” twice in a row [duplicate]

You need to reset the file pointer using

file.seek(0)

before using

file.readlines()

again.

Leave a Comment