I need to set some environment variables in the python script and I want all the other scripts that are called from python (shell scripts) which will be child process to see the environment variables set. 我須要在python腳本中設置一些環境變量,而且我但願從python調用的全部其餘腳本(shell腳本)(將是子進程)來查看設置的環境變量。 The value is a number. 該值爲數字。 python
If I do os.environ["DEBUSSY"] = 1
, it complains saying that 1
has to be string. 若是我作os.environ["DEBUSSY"] = 1
,它抱怨說1
必須是字符串。 I also want to know how to read the environment variables in python (in the later part of the script) once I set it. 我還想知道一旦設置好如何在python(在腳本的後半部分)中讀取環境變量。 shell