Computer >> Computer tutorials >  >> Programming >> Python

How to remove a directory recursively using Python?


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')