def getWinDrives():
 assert (os.name == u'nt')
 from ctypes import windll
 drives = []
 bitmask = windll.kernel32.GetLogicalDrives()
 for letter in string.uppercase:
  if (bitmask & 1):
   drives.append(letter)
  bitmask >>= 1
 return drives

def getWinDrives ( ) : assert ( os . name == u'nt' ) from ctypes import windll drives = [ ] bitmask = windll . kernel32 . GetLogicalDrives ( ) for letter in string . uppercase : if ( bitmask & 1 ) : drives . append ( letter ) bitmask >>= 1 return drives
return list of detected drives .