Using os
module I can get the values of the environment variables. For example:
os.environ['HOME']
However, I cannot set the environment variables:
os.environ['BLA'] = "FOO"
It works in the current session of the program but when I python program is finished, I do not see that it changed (or set) values of the environment variables. Is there a way to do it from Python?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…