#这是用来将子目录里的东西都列出来
import re
import os
typetofind="cue"
rr=re.compile("\.%s$"%typetofind,re.I)
rootdirs=[r"D:\TDDOWNLOAD\music",r"d:\tddownload\movie"]
ii=0
for rootdir in rootdirs:
wholefiles=os.walk(rootdir)
for p,d,f in wholefiles:
for file in f:
if rr.search(file):
ii=ii+1
print("file%d:"%ii+p+"\\"+file)
print("I have:%d "%ii+typetofind)
for root, dirs, files in os.walk('/home'):
for file in files:
print os.path.join(root, file)