使用Python's WMI package安装之前没有驱动器号的MSFT_Partition可以按以下方式完成:
import wmi
c=wmi.WMI(namespace=r'Microsoft/Windows/Storage')
partition=c.MSFT_Partition()[0] # Picking sensibly outside of scope of question
partition.AddAccessPath(None,True) # Use AssignDriveLetter
# This works so far and the mounted drive can be seen
# But now the Python object is outdated:
print('%c:'%partition.DriveLetter)
# Still prints '\x00:'
那么要求Python WMI模块刷新这个陈旧值的正确方法是什么?