Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- from filelock import Timeout, FileLock
- lock = FileLock("./test.txt.lock")
- with lock:
- x = open("./test.txt", "w")
- x.write("test\n")
- x.flush()
- while True:
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement