generate functionSun, 13 Nov 2022

Delete empty folders in "D:\sonarr" and "D:\radarr".

import shutil import os def deleteEmptyFolders(path): for root, dirs, files in os.walk(path, topdown=False): if not dirs and not files: os.rmdir(root) deleteEmptyFolders("D:\\sonarr") deleteEmptyFolders("D:\\radarr")

Questions about programming?Chat with your personal AI assistant