I have python script called generate_the_result.py
. The results can be produced by executing that script with one argument. For example generate_the_result.py my_arg_01
I have a file which the content is the list of arguments of the script.
## my list of arguments
my_arg_01
my_arg_02
my_arg_03
my_arg_04
my_arg_05
.
.
.
I want to execute each argument inside my file above on the generate_the_result.py
script one by one by looping. How is the best way to do that in python?
there are a lot of arguments inside the file,
a possible solution is read the file, do loop, inside the loop execute subprocess.call("generate_the_result.py [i]")
but is this the best way?