python–删除指定文件夹

hechaohua 26 0 PDF 2020-12-23 05:12:50

删除指定后缀文件 import os def del_files(path, delend): for root, dirs, files in os.walk(path): for name in files: if name.endswith(delend): os.remove(os.path.join(root, name)) print("delete file :", os.path.join(root, name)) if __name__ == '__main__':

用户评论
请输入评论内容
评分:
暂无评论