Modifying environment variables

Donn Cave donn at
Fri Dec 21 17:20:45 EST 2001

Quoth Terry Hancock <hancock at>:
| However, all this work is wasted, because after
| I leave the script, the PATH is unaffected. It
| seems that assigning values to os.environ['PATH']
| can affect subshells, but not the one I'm running
| the script from.
| Is there a way to get around this limitation? It
| would be a lot nicer if I could just call the
| script from the users' .cshrc file (I should've
| mentioned that they are invariably using csh or
| tcsh).

Right, it does no good to modify the environment.  You have to
write the value to output, and read it into PATH from the shell -
like  % setenv PATH `fudgepath`

	Donn Cave, donn at

More information about the Python-list mailing list