title: How do I get this terminal command to be executed from python?
body: <p>I have to run an executable for which input parameters are saved in a text file, say input.txt. The output is then redirected to a text file, say output.txt. In windows terminal, I use the command, </p>
  
  <pre><code>executable.exe &lt; input.txt &gt; output.txt
  </code></pre>
  
  <p>How can I do this from within a python program?</p>
  
  <p>I understand that this can be achieved using os.system. But I wanted to run the same using subprocess module. I was trying something like this,</p>
  
  <pre><code>input_path = '&lt;'+input+'&gt;'
  temp = subprocess.call([exe_path, input_path, 'out.out'])
  </code></pre>
  
  <p>But, the python code executes the exe file without directing the text file to it.</p>