Ubuntu – How we can change linux environment variable in python

12.04environment-variablespython

Let's say we are on a command line and we declare an environment variable:

export x=100

When i go to python and type :

os.environ['x'] = '100000'

If I came back to command line x stays 100. Is there any way to change this variable in python ?

Best Answer

There is no way to change the environment variables from a child process. And there is an exactly same question on SO.

Related Question