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
For Linux users, you can simply run the shell command in a pythonic way
import os os.system("rm -r /home/user/folder_name")
where rm stands for remove and -r for recursively
rm
-r