Similar question here. You can’t mix iteration and readline so you need to use one or the other.
while True:
line1 = f.readline()
line2 = f.readline()
if not line2: break # EOF
...
Similar question here. You can’t mix iteration and readline so you need to use one or the other.
while True:
line1 = f.readline()
line2 = f.readline()
if not line2: break # EOF
...