I need to write a python script that launches a shell script and import the environment variables AFTER a script is completed.
Immagine you have a shell script "a.sh":
export MYVAR="test"
In python I would like to do something like:
import os
env={}
os.spawnlpe(os.P_WAIT,'sh', 'sh', 'a.sh',env)
print env
and get:
{'MYVAR'="test"}
Is that possible?