james-l
3/21/2017 - 3:05 AM

python delete a dir tree python删除目录

python delete a dir tree python删除目录

import os
import shutil

os.remove() # will remove a file.

os.rmdir() # will remove an empty directory.

shutil.rmtree() # will delete a directory and all its contents.