subprocess & shared environments

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

On May 1, 12:09 am, Robert Dailey <rcdai... at> wrote:
> I'm currently calling on a batch file (in Windows)
> that sets a few environment variables that are needed by further
> processes started via 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