Setting environment variables.

Cameron Laird claird at starbase.neosoft.com
Sun Aug 22 08:47:27 EDT 1999


In article <37BDB88C.212EC063 at starmedia.net>,
Andrew Csillag  <andrew at starmedia.net> wrote:
>Oliver White wrote:
			.
			.
			.
>> 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.
			.
			.
			.
What's traditional for Unix programmers working within
{sh,bash,ksh,...} is to
  eval `my_env_setting_app`
at the command prompt.
-- 

Cameron Laird           http://starbase.neosoft.com/~claird/home.html
claird at NeoSoft.com      +1 281 996 8546 FAX




More information about the Python-list mailing list