如何在Windows上用Python中的给定字母获取硬盘的卷ID?

时间:2017-11-18 11:27:33

标签: python windows python-3.x winapi wmi

我需要一种方法来获取Python 3中Windows上看起来像xxxx-xxxx(例如A78B-12BF)的硬盘的卷ID。

drive_letter = "H:"
volume_id = get_volume_id(drive_letter)  # <--- what should be here?
print(volume_id)  # A78B-12BF

0 个答案:

没有答案