One thing I can recommend that makes scripting in python with external commands a lot easier is the `sh` module:
Basically you can just `from sh import [command]` and then have an installed binary command available as function
from sh import ifconfig
print(ifconfig("eth0"))