title: How to keep subprocess.Popen console open after crashing on Windows?
body: <p>My goals is to call the main program with several different arguments for each <code>Popen</code> process, each with its own console window. However, once a crash is encountered, it closes that console, and I'd really really like to keep it open instead.</p>
  
  <pre><code>import subprocess
  from subprocess import CREATE_NEW_CONSOLE
  import time
  
  for i in range(1, 5):
      subprocess.Popen(["python", "main.py", str(i), str(i)], close_fds=False, creationflags=CREATE_NEW_CONSOLE)
      time.sleep(3)
  </code></pre>
  
  <p>Is it possible to make a new process with <code>subprocess.Popen</code> and keep the console open for me to read errors?
  Link to <a href="https://docs.python.org/3/library/subprocess.html" rel="nofollow">subprocess docs</a>.</p>