title: Manipulating output from .exe via python script
body: <p>Does anyone know if it is possible to manipulate the output of an exe when calling it from the native os module in python? For example suppose we have some executable, call it <code>example.exe</code>, and when it is executed it asks the user for input, a file perhaps. </p>
  
  <p><code>os.system('example.exe')
   Enter file name:</code> &lt;--- this is the output from example.exe that requires user input, i.e. I have to type the file name in</p>
  
  <p>What I would like to be able to do is generate a list of the files in the cwd and then enter the files one by one as I call the script.</p>
  
  <p><code>file_list = os.listdir(os.getcwd())
   for f in file_list:
       os.system('example.exe')
       Enter file name: f</code></p>
  
  <p>But I am unsure if this is possible because it requires user input and I am not sure how to mimic that from script. </p>
  
  <p>Update: The issues arises because the <code>example.exe</code> has no option for providing arguments, e.g. I cannot do something like <code>example.exe filename</code> to provide the required input. </p>