Using "readlines()" twice in a row

io, python, readlines

Solution

You need to reset the file pointer using

file.seek(0)

before using

file.readlines()

again.

Problem

I'm trying to do something like this: ``` Lines = file.readlines() # do something Lines = file.readlines() ``` but the second time `Lines` is empty. Is that normal?

Original source

Related problems