4 ms·
I've really enjoyed this presentation. Thanks for sharing Implementation of "tail -f filename" in Python given as example. (slightly altered) def follow(fil
by plainOldText 15y ago
I've really enjoyed this presentation. Thanks for sharing
Implementation of "tail -f filename" in Python given as example. (slightly altered)
def follow(filename):
f = open(filename)
f.seek(0,2)
while True:
line = f.readline()
if not line:
continue
yield line
for new_line in follow('/tmp/test.file'):
print new_line
This is so cool.
- deleted 15y ago[deleted]