import os
import subprocess


processes = []
logfile = open("./create_data_log.txt", "a")
for file in os.listdir("./chains/"):
    run_command = ["python3", "./create_data.py", file]
    print(run_command)
    p = subprocess.Popen(run_command,stdout=logfile)
    processes.append(p)

done = 0
for p in processes:
    p.wait()
    done+=1
    print(f"{done} subprocess complete")
    