阅读背景:

在python中搜索文件的最后x行最有效的方法。

来源:互联网 

I have a file and I don't know how big it's going to be (it could be quite large, but the size will vary greatly). I want to search the last 10 lines or so to see if any of them match a string. I need to do this as quickly and efficiently as possible and was wondering if there's anything better than:I have a file and I don't know how big it's goi




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: