#!/usr/bin/env python
# -*- coding:utf-8 -*-
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)
dir_name = "d:\\LR\\WxServer\\friendfile\\resize\\"
del_file(dir_name)
原文:https://www.cnblogs.com/simadongyang/p/8832601.html