subprocess & shared environments

Aaron Brady castironpi at gmail.com
Fri May 1 17:18:05 EDT 2009


On May 1, 12:09 am, Robert Dailey <rcdai... at gmail.com> wrote:
> I'm currently calling subprocess.call() on a batch file (in Windows)
> that sets a few environment variables that are needed by further
> processes started via subprocess.call(). How can I persist the
> environment modifications by the first call() function? I've done my
> own searching on this and I came up with nothing.
>
> Help is appreciated.

I don't know if this will work, but you can try spawning a batch file
that calls the first program to set the variables, then executes the
second program.  You might need to create that batch file by hand, as
well as the command line for the second process.

You can also try setting the env. variables in the parent process, and
restoring them after.



More information about the Python-list mailing list