title: Python messing vim when spawning
body: <p>I'm trying to run a program from python and print the output based on its exit status.  The code below is outputting directly to my vim screen (messing it) instead of opening a shell with the output.</p>
  
  <p><img src="https://i.stack.imgur.com/D5ppN.png" alt="enter image description here"></p>
  
  <pre><code>python &lt;&lt; EOF
  import subprocess
  import vim
  
  cmd = "BAD_COMMAND"
  p = subprocess.Popen(cmd, shell=True)
  retcode = p.poll()
  if retcode &gt; 0:
      output_of_error = p.communicate()[0]
      vim.command("!echo show errors here")
  
  EOF
  </code></pre>