args = shlex.split(RunCprogram)
env = os.environ
new_env = {k: v for k, v in env.items() if 'MPI' not in k}
p = subprocess.Popen(RunCprogram, shell=True, env=new_env, stdout=
    subprocess.PIPE, stdin=subprocess.PIPE)
p.wait()
result = 'process myrank ' + str(myrank) + ' got ' + p.stdout.read()
print(result)
Python with embedded call to mpirun