carpeta python dlete
import shutil
shutil.rmtree('/folder_name')
Energetic Emu
import shutil
shutil.rmtree('/folder_name')
import os
import shutil
dirpath = os.path.join('dataset3', 'dataset')
if os.path.exists(dirpath) and os.path.isdir(dirpath):
shutil.rmtree(dirpath)
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)