tail

Marco Sulla Marco.Sulla.Python at gmail.com
Sat May 7 09:21:25 EDT 2022


On Sat, 7 May 2022 at 01:03, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
>
>         Windows also uses <cr><lf> for the EOL marker, but Python's I/O system
> condenses that to just <lf> internally (for TEXT mode) -- so using the
> length of a string so read to compute a file position may be off-by-one for
> each EOL in the string.

So there's no way to reliably read lines in reverse in text mode using
seek and read, but the only option is readlines?


More information about the Python-list mailing list