python 读取指定目录下的,指定类型文件 直接上代码: os.chdir(path) # 修改当前的工作目录 file_list = glob('*.log') # 过滤指定类型的文件 if file_list : for file in file_list: print(file)