Understanding The "tail -f In Python"
I have created a very simple python script: def read_then_follow(file): for line in file: yield line while True: line = file.readline() if not line:
Solution 1:
(I'm assuming you are on some Unix-like operating system.)
Saving in vim will actually create a new file with the same name on the disk. The file handle held by your script still points to the old file, which does not have a directory entry anymore. If your script terminates, the reference counter of the old file will drop to 0 and the file will be removed.
Post a Comment for "Understanding The "tail -f In Python""