title: Controlling a CLI program with Python
body: <p>I'm using Python 3.5 and I'd like to run a program that is normally run within cmd.exe or powershell.  This program is not in the environment PATH, and I'd like to avoid adding it.</p>
  
  <p>I need to start the program and then just pass two or three word commands within the program.</p>
  
  <p>I've looked on Stack Exchange and Google, but many things are references on how to launch a script with Powershell.  I need to issue commands one-by-one because the commmand timings are relevent to other parts of the application (other things in the program need to happen in a serial manner).</p>
  
  <p>I've tried to get <code>subprocess.call</code> to work, but I can't get it to launch the program...Same with <code>os.system</code>.</p>
  
  <p>PyWinAuto won't launch the program in it's own window, but rather just the console, so that's out....Plus, I can't get PyWinAuto to recognize that it should use the <code>SendKeys()</code> method on said console anyway.</p>
  
  <p>I'd like to launch:</p>
  
  <pre><code>C:\Program Files (x86)\whatever.exe
  </code></pre>
  
  <p>Then, when it launches, start sending in things like</p>
  
  <pre><code>command 1 argument 1 argument 2 &lt;enter&gt;
  command 2 argument 1 argument 2 &lt;enter&gt;
  command 3 argument 1 argument 2 &lt;enter&gt;
  </code></pre>