怎么用python最快的获取大文件的最后几行

如题所述

with open(filename) as openfile:
while True:
data = openfile.read(maxsize) # 读取文件块
if not data: # 直到读完文件
break
anotherfile.write(data)
温馨提示:答案为网友推荐,仅供参考
相似回答