I would like to set a couple of environment variables in a Python script, then use said environment variables in a chained call.
For example, a python script called set_env.py
:
os.environ["MY_VAR"] = "cool value"
And then in bash
python ./set_env.py && echo "$MY_VAR"
Is such a thing possible?
I’ve tried to use the os.environ
, os.system
using export MY_VAR=...
, but none of them seem to work.