python 获取内存型号的代码
以下是Python获取内存型号的代码:
import wmi
# 获取Win32_PhysicalMemory类的实例
c = wmi.WMI()
mem_items = c.Win32_PhysicalMemory()
# 遍历内存条并输出型号
for mem in mem_items:
print(mem.Caption)
该代码使用了Windows Management Instrumentation (WMI)来获取Win32_PhysicalMemory类的实例,然后遍历内存条并输出型号。请注意,此代码仅适用于运行Windows操作系统的计算机。
原文地址: http://www.cveoy.top/t/topic/dRHs 著作权归作者所有。请勿转载和采集!