rootdir='D:\\icon集合\\icon集合'
def listAllFiles(rootPath):
list=os.listdir(rootPath)
for i in range(0,len(list)):
path=os.path.join(rootPath,list[i])
if os.path.isfile(path):
print(path)
elif os.path.isdir(path):
listAllFiles(path)
listAllFiles(rootdir)
遍历取出指定文件夹下所有的文件
猜你喜欢
转载自www.cnblogs.com/smiler/p/9150413.html
今日推荐
周排行