[Python] How to implement a pythonic equivalent of tail -F?

Discussão em 'Python' iniciado por Stack, Dezembro 19, 2024.

  1. Stack

    Stack Membro Participativo

    What is the pythonic way of watching the tail end of a growing file for the occurrence of certain keywords?

    In shell I might say:

    tail -f "$file" | grep "$string" | while read hit; do
    #stuff
    done

    Continue reading...

Compartilhe esta Página