passing command line arguments to executable

Simon Brunning simon at brunningonline.net
Sat Apr 3 18:22:31 CEST 2010


On 3 April 2010 17:09, mcanjo <mcanjo at gmail.com> wrote:
> I have an executable (I don't have access to the source code) that
> processes some data. I double click on the icon and a Command prompt
> window pops up. The program asks me for the input file, I hit enter,
> and then it asks me for and output filename, I hit enter a second time
> and it goes off and does its thing and when it is finished running the
> Command Prompt goes away and I have my new output file in the same
> directory as my executable and input file. I would like to be able to
> batch process a group of files. I thought about using "os.spawnv()" in
> a loop and at each iteration of the loop passing in the file in and
> out names but that didn't work. Does anyone have any ideas?

Have a look at the subprocess module.

-- 
Cheers,
Simon B.



More information about the Python-list mailing list