【发布时间】:2020-04-20 08:01:31
【问题描述】:
现在我知道有 psutil 模块可供使用:
import psutil
a=psutil.virtual_memory()
print(a)
它显示了这个输出:
svmem(total=4238442496, available=1836089344, percent=56.7, used=2402353152, free=1836089344)
它有百分比,但我只想要 RAM 使用百分比而不需要所有其他功能,如已使用、免费等。这可能吗?请整理一下。提前感谢您的回答。
【问题讨论】:
-
a.percent?你有一个对象,你想访问它的一部分 -
我觉得这个帖子对你有用" stackoverflow.com/questions/938733/…>"
标签: python python-3.x windows psutil