Created
December 18, 2013 06:38
-
-
Save calebreister/8018190 to your computer and use it in GitHub Desktop.
Python script for accessing environment variables.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import os | |
>>> os.environ.keys() | |
KeysView(<os._Environ object at 0x013B8C70>) | |
>>> list(os.environ.keys()) | |
['TMP', 'COMPUTERNAME', 'USERDOMAIN', 'PSMODULEPATH', 'COMMONPROGRAMFILES', | |
...many more deleted... | |
'NUMBER_OF_PROCESSORS', 'PROCESSOR_LEVEL', 'USERPROFILE', 'OS', 'PUBLIC', 'QTJAVA'] | |
>>> os.environ['TEMP'] | |
'C:\\Users\\mark\\AppData\\Local\\Temp' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment