As someone who to this day still cringes every time they need to work with the subprocess module, do yourself a favor and use Kenneth Reitz's excellent wrapper library called Envoy:
https://github.com/kennethreitz/envoy
For reference, he's the same guy that did the Requests module, which is pretty much the defacto standard for avoiding urllib hell.