# os.environ

import os

for key in os.environ.keys():

    print '%s = %s' % (key, os.environ[key])

 

p = os.path.join(os.environ['USERPROFILE'], 'Desktop')

 

if os.path.isdir(p):

    print "\nPath '%s' is valid" % (p)

else:

    print "\nInvalid path"

 

# Partial Output

"""   

...............

HOMEDRIVE = C:

OS = Windows_NT

SYSTEMDRIVE = C:

NUMBER_OF_PROCESSORS = 1

PROCESSOR_LEVEL = 15

__COMPAT_LAYER = EnableNXShowUI

USERPROFILE = C:\Documents and Settings\Bruce H. Vaughan

 

Path 'C:\Documents and Settings\Bruce H. Vaughan\Desktop' is valid

>>>

"""