delete label.cache in folder valid and train using delete label.cache in folder valid and train in python in python

main.py
import os

folders = ['valid', 'train']

for folder in folders:
    file_path = os.path.join(folder, 'label.cache')
    if os.path.exists(file_path):
        os.remove(file_path)
        print(f'label.cache file deleted in {folder} folder.')
    else:
        print(f'label.cache file not found in {folder} folder.')
317 chars
12 lines

related categories

gistlibby LogSnag