I am trying to run multiple experiments, which are in different folder. I want to save the results in the main folder. Something like this:
Main folder
- Main_run_file.py
- Results.txt
- Experiment_1
- Run_file.py
- Experiment_2
- Run_file.py
- Experiment_3
- Run_file.py
I already tried with the following code:
import os
mydir = os.getcwd() # would be the MAIN folder
mydir_tmp = mydir + "\Experiment_1 - 40kmh" # add the first experiment folder name
mydir_new = os.chdir(mydir_tmp) # change the current working directory
mydir = os.getcwd() # set the main directory again
import Run_file
mydir = os.getcwd() # would be the MAIN folder
mydir_tmp = mydir + "/Experiment_1 - 60kmh" # add the second experiment folder name
mydir_new = os.chdir(mydir_tmp) # change the current working directory
mydir = os.getcwd() # set the main directory again
import Run_file
However, this only runs the first Run_file and not the second one. Can someone help me with this?