how to write a with block inside a while loop in python

前端 未结 0 458
灰色年华
灰色年华 2021-01-05 08:43
import time

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


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题