I\'m having a problem with deleting empty directories. Here is my code:
for dirpath, dirnames, filenames in os.walk(dir_to_search): //other codes try
Try rmtree() in shutil from the Python standard library
rmtree()