python 列出文件夹下所有的文件以及文件夹名 2020年6月16日 by 加班不给钱 import os path = 'D:\******……' #定义路径 folders = os.listdir(path) for folder in folders: print(folder)