1. 删除文件的命令
import os os.remove(file) os.unlink(file)
2.删除目录的命令
import shutil shutil.rmtree(directory)