p.wait() also returns the exit code, so this could be simplified to
```
       output += 'EXIT CODE: %s' % p.wait()
```