How to implement a pythonic equivalent of tail -F?

Viewed 32880

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
10 Answers
Related