Change current process environment's LD_LIBRARY_PATH

后端 未结 4 1546
故里飘歌
故里飘歌 2020-11-29 05:33

Is it possible to change environment variables of current process?

More specifically in a python script I want to change LD_LIBRARY_PATH so that on imp

4条回答
  •  一生所求
    2020-11-29 05:51

    well, the environment variables are stored in the dictionary os.environ, so if you want to change , you can do

    os.environ["PATH"] = "/usr/bin"
    

提交回复
热议问题