Tail for Python - python
Embed
You can embed this paste into a blog or website with this code:
<iframe class="codetidy" type="text/html" width="100%" src="http://codetidy.com/paste/embed/1845" frameborder="0"></iframe>
import time
import sys
def tail_f
(file):

interval
= 0.5
while True:

where
= file.
tell()
line
= file.
readline()
if not line:

time.
sleep(interval
)
file.
seek(where
)
else:

yield line

for line
in tail_f
(open(sys.
argv[1])):

print line
,