1import os.path
2
3def create_output(path, curves):
4    file_name_template = "{}_{}_{}.csv"
5    for key, curve in curves.items():
6        file_name = file_name_template.format(*key)
7        file_path = os.path.join(path, file_name)
8
9        with open(file_path, "w") as f:
10            for pH, value in curve:
11                f.write(str(pH)+', '+str(value)+'\n')