title: How to interact with an exe file with python
body: <p>I have an exe file which accepts input from the keyboard, and returns a response based on the input text. When trying to read the output returned by the exe the python script freezes.</p>
  
  <p>I'm running Windows 7 and python3.7. I've tried the answer at <a href="https://stackoverflow.com/questions/28493136/continuously-interacting-with-exe-file-using-python">continuously interacting with .exe file using python</a>.</p>
  
  <pre class="lang-py prettyprint-override"><code>from subprocess import Popen, PIPE
  
  location = "C:\\Users\\file.exe"
  
  p= Popen([location],stdin=PIPE,stdout=PIPE,stderr=PIPE, encoding="UTF8")
  command='START'
  p.stdin.write(command)
  response=p.stdout.read()
  </code></pre>
  
  <p>I expect response to be populated with the output text, but instead the program freezes on that line.</p>
  
  <p>The exe file that I want to interact with is <a href="https://gomocup.org/download-gomoku-ai/" rel="nofollow noreferrer">here</a> (EMBRYO file)</p>