Created
July 10, 2012 09:36
-
-
Save liekkas/3082312 to your computer and use it in GitHub Desktop.
python:删除指定的文件夹
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
# 功能:删除某个文件夹下面所有的cvs文件夹 | |
import os,shutil | |
# 删除某个项目里面所有为CVS的文件夹 | |
def del_dirs(path): | |
for parent,dirnames,filenames in os.walk(path): | |
for dirname in dirnames: | |
if dirname == 'CVS': | |
p = os.path.join(parent,dirname) | |
shutil.rmtree(p) | |
del_dirs(r"D:\environment\liekkasspaceBak\workSpaceCharts") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment