Yuck. At the least, let's pass the input to `communicate()` instead of having a separate call to `stdin.write()`. And to be honest, isn't it easier to rewrite this to just use subprocess directly?

```
p = Popen(cmd, stdout=subprocess.PIPE)
out, _ = p.communicate(_exit)
```