dicom-extractor-2023/drives.py

20 lines
406 B
Python

from ctypes import windll
from string import ascii_uppercase
class Drives:
def __init__(self):
self.list = self.getDrives()
@staticmethod
def getDrives():
drives = []
bitmask = windll.kernel32.GetLogicalDrives()
for letter in ascii_uppercase:
if bitmask & 1:
drives.append(letter)
bitmask >>= 1
return drives