code: def rmtree_glob(file_glob):
      
      for item in glob(file_glob, recursive=True):
          try:
              os.remove(item)
              print('%s removed ...' % item)
          except OSError:
              try:
                  shutil.rmtree(item)
                  print('%s/ removed ...' % item)
              except OSError as err:
                  print(err)
docs: Platform independent rmtree, which also allows wildcards (globbing)