import os
import shutil

logdir = "data/local/experiment/"
for filename in os.listdir(logdir):
    log_filename = os.path.join(logdir, filename, "progress.csv")

    if os.path.exists(log_filename) and os.stat(log_filename).st_size == 0:
        print("Deleting {} ... ".format(os.path.join(logdir, filename)))
        shutil.rmtree(os.path.join(logdir, filename))
