You need to export the variables in bash, or they will be local to bash:
export test1
Then, in python
import os
print os.environ["test1"]
You need to export the variables in bash, or they will be local to bash:
export test1
Then, in python
import os
print os.environ["test1"]