os remove entire folder python

Solutions on MaxInterview for os remove entire folder python by the best coders in the world

showing results for - "os remove entire folder python"
Manuel
02 Aug 2020
1import os
2import shutil
3
4os.remove('/your/path/to/file.txt') #removes a file.
5
6os.rmdir('/your/folder/path/') #removes an empty directory.
7
8shutil.rmtree('/your/folder/path/') #deletes a directory and all its contents.