/BackwardsReaderIter

A iteration to read a file from backwards. It avoids to load the whole file into the memory. It's fast and light.

Primary LanguagePython

BackwardsReaderIter

I have used BackwardsReader before. It's really good but I think if a iter is available, it will be better.

So I enhanced it on iteration part.

Before when you use BackwardsReader:

br = BackwardsReader(open('bar'))

while 1:
	line = br.readline()
	if not line:
	    break
	print repr(line)`

Now use BackwardsReaderIter:

bri = BackwardsReaderIter(file_name)
for line in bri.backread():
	print line