I'm trying to create an environment variable in Ubuntu by Python.
Here is what I've done so far:
import os
os.environ['NEW_ENV_VAR'] = '1'
print(os.environ['NEW_ENV_VAR'])
Out:
1
Apparently, I can write and read this variable on this same code, but I couldn't read it on its OS or another code:
$ echo $NEW_ENV_VAR