Se você deseja executar algum programa usando Python, por exemplo, maven build use este
import subprocess
mavenProcess = subprocess.Popen('mvn clean install', stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
# use forwarder streams
print mavenProcess.stdout.read(-1)
print mavenProcess.stdin.read(-1)
print mavenProcess.stderr.read(-1)