It's because when python reads a file, it has a position in the file and it reads from this position. After the call to open, the position is at the beginning of the file, but after readlines(), the position is at the end of the file. You could do this
>>> f = open(....)
>>> beginning = f.tell() # get the current position
>>> f.readlines() # read the whole file
>>> f.seek(beginning) # go back to the beginning
>>> f.readlines() # should produce the same result as the first readlines()
in principle, seek accepts any value that was returned by a previous tell.