I want to execute a python script from within a for loop.
What I tried was more or less the following:
input_dir_parent='/home/.../parent_folder/'
for input_directory in os.listdir(input_dir_parent):
python process.py --input_dir input_directory
So I want to pass a variable (that changes after each iteration) from the for-loop as an argument to the process.py script. This does not work however. The input_directory after --input_dir will not be a reference to the input_directory but just an 'independant' arguement (in this case it will be handled as a string 'input_directory'). Is there another way to do what I want?