0.環境
windows
python3.6
1.フォルダ全体を削除します
import shutil
your_want_rm_path = “E:/data/1/”
shutil.rmtree(your_want_rm_path, ignore_errors=True)
2.ファイルを削除します
import os
old_file = “E:/data/1/1.txt”
os.remove(old_file)
windows
python3.6
import shutil
your_want_rm_path = “E:/data/1/”
shutil.rmtree(your_want_rm_path, ignore_errors=True)
import os
old_file = “E:/data/1/1.txt”
os.remove(old_file)