f=open('a.txt','rb')
for I in f:
offs=-10
while True:
f.seek(offs,2)
data=f.readlines()
if len(data) > 1:
print('文件的最后一行是%s' %(data[-1].decode('utf-8')))
break
offs*=2
f=open('a.txt','rb')
for I in f:
offs=-10
while True:
f.seek(offs,2)
data=f.readlines()
if len(data) > 1:
print('文件的最后一行是%s' %(data[-1].decode('utf-8')))
break
offs*=2