使用Python获取Windows中计算机的内存使用情况 [英] Get memory usage of computer in Windows with Python
本文介绍了使用Python获取Windows中计算机的内存使用情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何判断Windows XP上运行的计算机的总体内存使用量是多少?
How can I tell what the computer's overall memory usage is from Python, running on Windows XP?
推荐答案
You'll want to use the wmi module. Something like this:
import wmi
comp = wmi.WMI()
for i in comp.Win32_ComputerSystem():
print i.TotalPhysicalMemory, "bytes of physical memory"
for os in comp.Win32_OperatingSystem():
print os.FreePhysicalMemory, "bytes of available memory"
这篇关于使用Python获取Windows中计算机的内存使用情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文