%SystemDrive%

rtilley rtilley at vt.edu
Wed Feb 15 13:48:00 EST 2006


Is there a proper way to get this variable from Windows? I know it's in 
the registry, but I'd rather not go there. I could not find a CSIDL 
shell constant for it either. I've been doing this:

os.chdir('/')
sys_drive = os.getcwd()
print sys_drive
C:\

This seems too much of a hack and maybe not 100% right all of the time. 
How could it be done better?



More information about the Python-list mailing list