#!/usr/bin/env python
#coding=utf-8
#os_walk.py
import os
def walkdir(path,rmdirectories):
for root, dirs, files in os.walk(path):
for f in files:
for d in rmdirectories:
#print f,type(f),"==>",d,type(d)
if f == d:
fg=os.path.join(root,f)
print fg+"==>rm"
os.remove(fg)
if __name__=='__main__':
path=u'E:\TDDownload\新概念英语'
rmdirectories=[u"VOA英语网.url",u"优习英语网.url",u"更多下载.txt"]
walkdir(path,rmdirectories)