新建一个Console应用程序,项目名称为“FileSystemWatcher”,Copy代码进,编译后就可以用了.代码如下: using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Security.Permissions; namespace MyFileSystemWatcher { public class Watcher { public stati
python中可以用os.walk来遍历某个文件夹中所有文件夹和文件. 例1: import os filePath = 'C:/Users/admin/Desktop/img' for dirpath, dirnames, filenames in os.walk(filePath): print(dirpath, dirnames, filenames) 输出结果: 例2: import os filePath = 'C:\\Users\\admin\\Desktop\\img' for d