It's just shifting the burden perhaps, but if you're on a Unix system you should be able to use tac(1) to reverse your file a bit faster: import os for line in os.popen('tac myfile.txt'): #do something with the line