1 2 3 4 5 6 7 8 9 10 11 |
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) del_file('D:\\test') |
近期评论