用python遍历一个文件夹下所有文件名称 可以用字典的方式,程序可参考程序“E:\untitled\weather\extact_copy.py” #coding=utf-8 import os import os.path rootdir = "E:\\weather_data\\pressure\\data_before" # 指明被遍历的文件夹 for parent,dirnames,filenames in os.walk(roo