bblr001的博客watchdog的官网示例是监控一个文件夹下面的文件变动,在监控多目录下不实用。下面代码展示监控多目录 from watchdog.observers import Observer from watchdog.events import * import time class ...
换个名字就很好的博客递归地创建多个不存在的目录 import os pth = r"dir1" # dir1不存在 if not os.path.exists(pth): os.mkdir(pth) import os pth = r"dir2/dir3" # dir2, dir3都不存在 if not os.path.exists(pth): os.mkidr...