shutil.rmtree ()

shutil.rmtree() means to recursively delete all subfolders and subfiles under the folder.


So if you want to delete a folder under E drive, you can use

shutil.rmtree('E:\\myPython\\image-filter\\test', ignore_errors=True)
This way all files in the test folder (including test itself) are deleted and errors are ignored.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325969571&siteId=291194637