删除目录及该目录下文件的Python脚本
import os
CUR_PATH = input("请输入删除的目录:")
def del_file(path):
ls = os.listdir(path)
for i in ls:
c_path = os.path.join(path, i)
if os.path.isdir(c_path):
del_file(c_path)
else:
os.remove(c_path)
del_file(CUR_PATH)