Re: Modify environment variable for subprocess

2015-09-23 Thread Akira Li
loial writes: > I need to modify the LIBPATH environment variable when running a > process via subprocess, but otherwise retain the existing environment. > > Whats the best way to do that? Pass env=dict(os.environ, LIBPATH=value) parameter: import os import subprocess subprocess.check

Re: Modify environment variable for subprocess

2015-09-23 Thread Laura Creighton
In a message of Wed, 23 Sep 2015 02:51:53 -0700, loial writes: >I need to modify the LIBPATH environment variable when running a process via >subprocess, but otherwise retain the existing environment. > >Whats the best way to do that? import subprocess, os my_env = os.environ # if your program s

Re: Modify environment variable for subprocess

2015-09-23 Thread Cameron Simpson
On 23Sep2015 02:51, loial wrote: I need to modify the LIBPATH environment variable when running a process via subprocess, but otherwise retain the existing environment. Whats the best way to do that? Make a copy of os.environ, modify the copy, pass it via the env=parameter of subprocess.Pop

Modify environment variable for subprocess

2015-09-23 Thread loial
I need to modify the LIBPATH environment variable when running a process via subprocess, but otherwise retain the existing environment. Whats the best way to do that? -- https://mail.python.org/mailman/listinfo/python-list