import time while True: with open("D:\\\\Files\\deskyo.txt",\'w\',encoding = \'utf-8\') as f: f.write("100 \\n") time.sleep(10)