If you are using linux, you can do the following. Use python glob library
Allows you to create a directory structure with the following structure.
/map
/ map / Zoom1 /
/ map / Zoom2 /
/ map / Zoom3 /
Using glob and shutil
import glob import shutil sub_folders_pathname = '/map/zoom*/' sub_folders_list = glob.glob(sub_folder_pathname) for sub_folder in sub_folders_list: shutil.rmtree(sub_folder)
sub_folders_pathname is a shell wildcard, glob supports shell wildcards.
sub_folders_list is a list of folders, and we use shutil.rmtree to delete it.
source share