using
   os.chdir('/')
   os.getcwd()
is plain wrong in Windows.

what it does is change the current directory to root of the CURRENT
DRIVE (i.e. the drive of the directory where script was started from),
not the system drive. for example, if current directory was
c:\myscripts and system drive is d:, this will return c:\ and not d:\.
hence chdir doesnt do any good, you can do os.getcwd()[:3] with the
same success.

os.environ['SYSTEMDRIVE'] is the right way to go.
btw it correctly returns just drive letter and colon, a drive name
doesnt include [back]slash

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to