import os path = r'路径' for dir_path,dir_names,file_names in os.walk(path): for filename in file_names: print(os.path.join(dir_path,filename))