标签:
1 import os 2 3 def getFiles(rootDir): 4 if os.path.isfile(rootDir): 5 print(rootDir) 6 elif os.path.isdir(rootDir): 7 for x in os.listdir(rootDir): 8 getFiles(os.path.join(rootDir, x)) 9 10 with open(‘C:\\Users\\10207695\\Desktop\\FileList.txt‘, ‘r‘) as f: 11 lines = f.readlines() 12 for line in lines: 13 line = line.strip(‘\n‘) 14 getFiles(line)
标签:
原文地址:http://www.cnblogs.com/rmthy/p/5953790.html