TECHIES WORLD

For Techs.... Techniques.... Technologies....

LinuxPython

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