Setting environment variables.

Andrew Csillag andrew at starmedia.net
Fri Aug 20 16:20:28 EDT 1999


Oliver White wrote:
> 
> I'm writing my first python program...
> 
> The program is intended to give a menu of choices, from which the
> CVSROOT environment variable is set (I'm sick of swapping around
> manually for sucking down code from different places). I'm wondering how
> I would do that.
> 
> I'm running GNU/Linux, is there an issue with processes... eg, after
> running my python program as a child process, will the changes to the
> environment variable affect it's parent (the *term)? (suspecting no) Is
> there annother way to set the parent's?

You would be correct, changing environment variables in a child process
won't affect the parents environment variables.  A way to do it is have
the child process print the new value of the environment variable to
stdout and have the parent read this value (probably using os.popen or
similar) and set its environment accordingly.
-- 
"Programmers are just machines that convert coffee to executable code"
   -Unknown

"Drew Csillag" <drew_csillag at geocities.com>




More information about the Python-list mailing list