Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

delete directory if exists python

os.remove() is to remove a file.

os.rmdir() is to remove an empty directory.

shutil.rmtree() is to delete a directory and all its contents.
	shutil.rmtree(dirpath)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #directory #exists #python
ADD COMMENT
Topic
Name
1+5 =