tail

Marco Sulla Marco.Sulla.Python at gmail.com
Sun Apr 24 11:56:18 EDT 2022


On Sun, 24 Apr 2022 at 00:19, Cameron Simpson <cs at cskk.id.au> wrote:

> An approach I think you both may have missed: mmap the file and use
> mmap.rfind(b'\n') to locate line delimiters.
> https://docs.python.org/3/library/mmap.html#mmap.mmap.rfind
>

Ah, I played very little with mmap, I didn't know about this. So I suppose
you can locate the newline and at that point read the line without using
chunks?


More information about the Python-list mailing list