How to read a file in reverse order using python? I want to read a file from last line to first line.
If you are concerned about file size / memory usage, memory-mapping the file and scanning backwards for newlines is a solution:
How to search for a string in text files?