python脚本实现删除Windows非空目录
def delete_dire(dire):
dir_list = []
for root, dirs, files in os.walk(dire):
for afile in files:
os.remove(os.path.join(root, afile))
for adir in dirs:
dir_list.append(os.path.join(root, adir))
for bdir in dir_list:
os.rmdir(bdir)
http://www.sanlelearning.com/