import wmi
import time

c=wmi.WMI()
while True:
    for cpu inc.Win32_Processor():
         timestamp=time.strftime('%a, %d %b %Y %H:%M:%S',time.localtime())
        print '%s | Utilization: %s: %d %%' % (timestamp,cpu.DeviceID,cpu.LoadPercentage)
         time.sleep(5)

 

 

当然你需要wmi

wmi url:http://timgolden.me.uk/python/wmi/index.html

相关文章:

  • 2021-07-03
  • 2021-12-21
  • 2021-08-18
  • 2021-12-18
  • 2021-11-23
猜你喜欢
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2021-08-01
  • 2022-12-23
相关资源
相似解决方案