p
File size: 352 Bytes
1b420ad
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import os
import shutil

ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
IMAGES_DIR = os.path.join(ROOT_DIR, "images")
STASH_NAME = "Stash"

if os.path.isdir(IMAGES_DIR):
    for folder in os.listdir(IMAGES_DIR):
        if folder != STASH_NAME:
            shutil.rmtree(os.path.join(IMAGES_DIR, folder), ignore_errors=True)