(filename, target)
| 3 | import time |
| 4 | |
| 5 | def follow(filename, target): |
| 6 | with open(filename, 'r') as f: |
| 7 | f.seek(0,os.SEEK_END) |
| 8 | while True: |
| 9 | line = f.readline() |
| 10 | if line != '': |
| 11 | target.send(line) |
| 12 | else: |
| 13 | time.sleep(0.1) |
| 14 | |
| 15 | # Decorator for coroutines |
| 16 | from functools import wraps |
no test coverage detected