Python遍历文件夹

import os
import os.path
path = os.walk("I:\\xxx")

for root,dir,files in path:
  #此处的files就是一个个文件夹文件的列表
  #循环遍历每一个列表
for name in files: print(root+'/'+name)

 

posted @ 2017-05-17 12:34  RonyJay  阅读(186)  评论(0)    收藏  举报