Answers for "python program to delete files inside a folder that has the name"

-1

python how to delete a directory with files in it

import shutil

dir_path = '/tmp/img'

try:
    shutil.rmtree(dir_path)
except OSError as e:
    print("Error: %s : %s" % (dir_path, e.strerror))
Posted by: Guest on December-22-2020
0

python delete folder and contents

import shutil
shutil.rmtree("dir-you-want-to-remove")
Posted by: Guest on February-01-2022

Code answers related to "python program to delete files inside a folder that has the name"

Python Answers by Framework

Browse Popular Code Answers by Language