Untitled

 avatar
unknown
python
2 years ago
363 B
3
Indexable
#!/usr/bin/python3

import io
import time

with open('log.txt', 'r') as f:
    f.seek(0, io.SEEK_END)
    eof = f.tell()

    print('start sleep')
    time.sleep(10)
    print('end sleep')
    
    #f.seek(0, io.SEEK_END)
    #eof = f.tell()
    f.seek(0, io.SEEK_SET)

    i = 0
    while f.tell() != eof:
        print(f'{f.readline()}', end='')
        i += 1
Editor is loading...