os.environ conflicts with my shell
lewst
lewst at yahoo.com
Tue Mar 28 22:26:48 EST 2000
I'm having problems with os.environ conflicting with my shell when
trying to set environment variables. I'll illustrate with an example.
Take the following short Python program:
#!/usr/bin/env python
# start up an xterm with $NAME="John Q. Public"
import os
os.environ["NAME"] = "John Q. Public"
os.system("xterm &")
The trouble is that the environment in the new xterm still contains
the old value of the $NAME environment variable. I'm guessing this is
because $NAME is also set in my .zshrc which overwrites the value
Python assigned to $NAME.
How can I get the value of os.environ["NAME"] to stick in new xterm's
environment?
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
More information about the Python-list
mailing list