import os
import psutil
info = psutil.virtual_memory()
print(u'cpu个数:',psutil.cpu_count())
print(u'电脑总内存:%.4f GB' % (info.total / 1024 / 1024 / 1024))
print(u'当前进程的内存使用:%.4f GB' % (psutil.Process(os.getpid()).memory_info().rss / 1024 / 1024 / 1024) )
标签:info,1024,%.,python,占用,psutil,内存,print
From: https://www.cnblogs.com/xzh-personal-issue/p/17748979.html