python递归遍历路径下的所有文件夹,并输出所有文件的绝对路径import os OriPath = r'/home' #需要遍历的文件夹 for root, dirs, files in os.walk(OriPath, topdown=False): for name in files: print(os.path.join(root, name)) Last modification:March 1, 2023 © Reprint prohibited Support Appreciate the author AliPayWeChat Like V50%看看实力