import os
li=[]
def listFiles(path):
print path
for name in os.listdir(path):
if os.path.isdir(path+"\\"+name):# is folder
listFiles(path+"\\"+name)
else:
li.append(path+"\\"+name)
return li
print len(listFiles("D:\demo"))
沒有留言:
張貼留言