how can I find out the value of an environment variable?

Tim Roberts timr at probo.com
Thu Mar 8 02:08:53 EST 2007


"ken" <ken.carlino at gmail.com> wrote:
>
>how can I find out the value of an environment variable in my pythong
>script?

 C:\Apps\Python24>python
 Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on
win32
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import os
 >>> os.environ['PATH']

'C:\\WINDOWS\\system32;c:\\WINDOWS;c:\\WINDOWS\\System32\\Wbem;c:\\bin;e:\\bin'
 >>>
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list