[英]How can I delete the Read files after --->>(for root, dirs, files in os.walk()) <<— with function os.remove() in python
import shutil import threading import glob import os import shutil import threading import glob import os
def test():
threading.Timer(5.0, test).start () # Was checked every 3
for root, dirs, files in os.walk("/mydir"):
for file in files:
print(file)
os.remove(" ") #delete the file
print("remove the file")
test() 测试()
I believe you want to find the real path of that file to remove it, This answer might help. 我相信你想找到该文件的真实路径来删除它,这个答案可能有所帮助。 Python cant get full path name of file
Python无法获取文件的完整路径名
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.