title: How do you call a windows .exe file from Python, enter parameters, and get a file output?
body: <p>Apologies in advance - I'm very new to Python and the subprocess documentation goes way over my head!</p>
  
  <p>I have a windows executable that converts a proprietary file type to a Geotiff.  When I run the executable, it prompts me to put in the file name I'd like to use, and then gives me several options in turn - what would I like to do (option 6), what output file type (option 3) etc., finally ending with asking me for an output file name.  I have about 2,000 images to convert, so I'd like to automate this process.  </p>
  
  <p>I've tried several variations on </p>
  
  <pre><code>subprocess.Popen('executable, input file, arguments, outputfile')
  </code></pre>
  
  <p>or </p>
  
  <pre><code>prog = subprocess.call('executable',stdout=PIPE,stdin=PIPE,stederr=PIPE)
  out, err = prog.communicate('filename\narguments\noutputfile')
  </code></pre>
  
  <p>or </p>
  
  <pre><code>result = subprocess.check_output(['executable','inputfile','arguments','outputfile')
  </code></pre>
  
  <p>Following suggestions from other questions on this site.  None of them give me errors, but they cause the file to just sit there running and doing nothing.  What commands should I use to run my executable file with the correct arguments and save the output Geotiff generated by the Windows executable?</p>
  
  <p>Thanks!</p>