python 获取子目录下的所有文件的路径

import os

pathss=[]
for root, dirs, files in os.walk(tarpath):
	path = [os.path.join(root, name) for name in files]
        #print(path)
	pathss.extend(path)

  

posted on 2018-09-21 14:29  hailuo  阅读(3144)  评论(1编辑  收藏  举报