How to read a file in reverse order using python? I want to read a file from last line to first line.
import sys f = open(sys.argv[1] , 'r') for line in f.readlines()[::-1]: print line