import os file_dir = "C:/Users/lab407/star/imageColorize/jpg/" for root,dirs,files in os.walk(file_dir): print("待处理的文件数为:"+str(len(files))) print("打印全部文件名"+str(files)) print("路径为:"+root)