import os
file_path = "/mnt/shared-storage-user/caipengxiang/workspace/ChemBOMAS/train_regression/data4regression/grouped_exp/buchwald"
files = os.listdir(file_path)

target = "/mnt/shared-storage-user/caipengxiang/workspace/ChemBOMAS/train_regression/data4regression/buchwald_{file}/searchspace.csv"

for file in files:
    ori_path = os.path.join(file_path, file)
    os.system(f"cp '{ori_path}' '{target.format(file=file)}'")
    
    cnm_path = f"/mnt/shared-storage-user/caipengxiang/workspace/ChemBOMAS/train_regression/data4regression/buchwald_{file}"
    os.system(f"cd '{cnm_path}' && python main.py")