os.environ => invalid token
Jeff Pinyan
jeffp at crusoe.net
Wed Aug 11 12:56:28 EDT 1999
[posted & mailed]
On Aug 11, Peter Torstenson blah blah blah:
> I tried the os.environ['HOME'] statement from the libref. man to get a
> string with the home directory.
Are you sure you imported the os module?
>>> import os
>>> print os.environ['HOME']
/home/jeffp
Works fine for me. What OS are you on?
You can also check what python sees as your environment by doing:
>>> import os
>>> for n in os.environ.keys():
... print n + "=" + os.environ[n]
--
jeff pinyan japhy at pobox.com japhy+perl at pobox.com japhy+crap at pobox.com
japhy's little hole in the (fire) wall: http://www.pobox.com/~japhy/
japhy's perl supposit^Wrepository: http://www.pobox.com/~japhy/perl/
The "CRAP" Project: http://www.pobox.com/~japhy/perl/crap/
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
More information about the Python-list
mailing list