标签: python windows python-3.x winapi wmi
我需要一种方法来获取Python 3中Windows上看起来像xxxx-xxxx(例如A78B-12BF)的硬盘的卷ID。
xxxx-xxxx
drive_letter = "H:" volume_id = get_volume_id(drive_letter) # <--- what should be here? print(volume_id) # A78B-12BF