title: How to run a command line program with interactive inputs from python?
body: <p>I am new to Python. I use a molecular modeling program (Fortran, no source code) that runs from the Windows command prompt that prompts a user to insert variables, e.g. symmetry, number of molecules, file name, etc., and then runs a simulation and outputs the results of the simulation as .pdb and .txt files. In the modeling program I have to wait for specific prompts to input each variable. </p>
  
  <p>I would like to automate the input process with python, changing one variable each time.
  The python program would look like this:</p>
  
  <p>1) Initiate the modeling program ("ranch")</p>
  
  <p>2) Input var 1, var 2, var 3, etc. in order, when prompted by the program.</p>
  
  <p>3) Generate the output files</p>
  
  <p>4) Go back to number one with a new var 1, keeping all other variables the same.</p>
  
  <p>I can't figure out how to do step 2. I think subprocess should work, but I can't figure out how to input each variable only when prompted by the modeling program. Is it even possible to do this? </p>
  
  <p>Thanks.
  I am running Windows 7.</p>