]]>涓嶈兘璁╁瀮鍦懼悶鍣簡(jiǎn)瀹濊吹鐨勭‖鐩?/title>http://www.shnenglu.com/yuanyajie/archive/2009/04/27/81267.html娓呮簮娓告皯娓呮簮娓告皯Mon, 27 Apr 2009 14:02:00 GMThttp://www.shnenglu.com/yuanyajie/archive/2009/04/27/81267.htmlhttp://www.shnenglu.com/yuanyajie/comments/81267.htmlhttp://www.shnenglu.com/yuanyajie/archive/2009/04/27/81267.html#Feedback0http://www.shnenglu.com/yuanyajie/comments/commentRss/81267.htmlhttp://www.shnenglu.com/yuanyajie/services/trackbacks/81267.html 1#written by gameogre 2#娓呯悊VC鍨冨溇錛?/span> 3import os 4import fnmatch 5postfixes=['*.obj','*.pdb','*.manifest','*.idb','*.ilk'] 6def IsObjFile(filename): 7for aPostfix in postfixes: 8if (fnmatch.fnmatch(filename,aPostfix)): 9return True 10return False 11for (root,subs,files) in os.walk("."): 12for aFile in files: 13if IsObjFile(aFile): 14 os.remove(os.path.join(root,aFile)) 15print os.path.join(root,aFile) 16print'mession is over ,press Enter to quit' 17quit=raw_input() 18
1#---------------------------- 2#娓呯悊SVN 3# written by gameogre 4import os 5import shutil 6import fnmatch 7from stat import* 8for root,dirs,files in os.walk('.'): 9for name in dirs: 10if name=='.svn': 11 os.chmod(os.path.join(root,name),S_IWRITE) 12for theRoot,theDirs,theFiles in os.walk(os.path.join(root,name)): 13for aFile in theFiles: 14 os.chmod(os.path.join(theRoot,aFile),S_IWRITE) 15 shutil.rmtree(os.path.join(root,name)) 16print os.path.join(root,name) 17print"mission is over, press Enter Key quit" 18exit=raw_input() 19