os.environ and os.path.chdir

Peter Hansen peter at engcorp.com
Sat Sep 20 02:06:53 CEST 2003

Yun Mao wrote:
>    How to make changes to os.environ and os.path.chdir still effective after
> I run the script? Currently, the changes are only good within my script. I
> would like the shell who called python myprog.py also gets the change..

Is there some Python programming course where all you guys are
coming from lately?  :-)  This question seems very popular this week.

As John Roth just replied to one of your potential classmates :-),
"Look at the thread "Setting Environment Variables" that started
yesterday in the early morning." ... and note that the comments
about environment variables apply equally to the current directory,
as both are properties of the calling shell and can be changed only
by scripts run by that shell.


More information about the Python-list mailing list