https://www.cnblogs.com/dwtt/p/7772639.html
使用了递归
import os
def del_file(path):
for i in os.listdir(path):
path_file = os.path.join(path,i) // 取文件绝对路径
if os.path.isfile(path_file):
os.remove(path_file)
else:
del_file(path_file)
os.removedirs(path)
亲测如果不增加os.removedirs(path)的话不能删除最后空的文件夹