I have a program that I run from the command line that takes two file arguments like this:
$ my_program
I would like to write a python script that can be used to run iterations of this program using different file arguments. For example:
$ my_program <file_1> <file_4>
$ my_program <file_2> <file_4>
$ my_program <file_3> <file_4>
...
I am trying to use the subprocess module from within python to run iterations of this program. What I can’t seem to figure out is how I can iterate throguth different file arguments and then run each of these commands from the command line. Can anyone point me in the right direction or provide some example code that woudl explain how this could be done. Thanks in advance for the help!
From what I gather, you want something like this:
then if you want to iterate through many, something like: