作者: Jim Wang 公众号: 巴博萨船长
摘要:Python 是如何访问和控制系统的环境变量的,Python中的父进程与子进程间的环境变量关系是何?能不能在运行时修改环境变量?子进程中对环境变量修改能不能传递给对父进程?如果能,怎么样实现这样的变化?如何使用subprocess.Popen运行vcvars.bat,然后在持续集成时,完成devenv清理和创建的前期准备。
Abstract: How does Python access and control the system‘s environment variables? What is the relationship between the environment variables of the parent process and the child process in Python? Can environment variables be modified at runtime? Can the modification of environment variables in the child process be passed to the parent process? If so, how to achieve such a change? How to use subprocess.Popen to run vcvars.bat, and then complete the preliminary preparations for the Clean and Build of devenv during CI.
阅读全文