0

The function "shutil.rmtree('dir_path') " does remove the content of the folder, however, it also throw the exception as follow "[WinError 5] Access is denied: 'dir_path'"

from shutil import rmtree
my_folder = 'aaa/bbb/'
try:
    rmtree(my_folder)
except Exception as err:
    print (err)
Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
eltal
  • 1

0 Answers0