How to read a file in reverse order using python? I want to read a file from last line to first line.
a simple function to create a second file reversed (linux only):
import os def tac(file1, file2): print(os.system('tac %s > %s' % (file1,file2)))
how to use
tac('ordered.csv', 'reversed.csv') f = open('reversed.csv')