How to remove a directory recursively using Python?

PythonServer Side ProgrammingProgramming

If you want to delete a folder containing all files and folders you want to remove, you can remove the folder(or tree) as follows:

>>> import shutil
>>> shutil.rmtree('my_folder')
raja
Updated on 01-Oct-2019 12:27:16

Advertisements