#!/usr/bin/env python3
# _*_coding:utf-8_*_
# Auth by raysuen
import os,sys
def ForceRMDir(DirName):
ret = 0
try:
os.rmdir(os.path.abspath(DirName))
except FileNotFoundError as e:
print(e)
ret = 1
except OSError as e:
for i in os.listdir(os.path.abspath(DirName)):
if os.path.isfile("%s/%s"%(os.path.abspath(DirName),i)):
os.remove("%s/%s"%(os.path.abspath(DirName),i))
else:
ForceRMDir("%s/%s"%(os.path.abspath(DirName),i))
except Exception as e:
print(e)
return 2
finally:
if ret == 0:
os.rmdir(os.path.abspath(DirName))
return retpython可以做什么
Python是一种编程语言,内置了许多有效的工具,Python几乎无所不能,该语言通俗易懂、容易入门、功能强大,在许多领域中都有广泛的应用,例如最热门的大数据分析,人工智能,Web开发等。









