Delete folder and its contents recursively in Python

Shutil module provides the utility to remove folder and its contents recursively.

import shutil
shutil.rmtree(folder)

Where 'folder' is the name of the folder that need to be removed.

 

Leave a Reply

Your email address will not be published. Required fields are marked *