Alternative file reading

This construction is more flexible and traditional in Python (and a bit strange...):
while 1:
    line = ifile.readline()  # read a line
    if not line: break       # end of file: jump out of loop
    # process line
i.e., an 'infinite' loop with the termination criterion inside the loop

previousnexttable of contents