Let's take a look at the python script execvpe.py in /home/bernd/python, which calls our bash script in bin2:
import os
env = {"PATH":"/home/bernd/bin2", "XYZ":"BlaBla"}
args = ("test","abc")
os.execvpe("test.sh", args, env)
We start execvpe.py on the command line and get the following output:
$ ./execvpe.py
/home/bernd/bin2/test.sh, abc
XYZ: BlaBla
PATH: /home/bernd/bin2/
current directory: /home/bernd/python/
$