Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 使用 Python 获取文件的最后 n 行,类似于 tail
你好,
如何让 Python 返回文件的最后 n 行而不逐行读取?
像这样的东西:
seek()
n
不确定是否有内置的方法可以做到这一点。