python监控本机cpu的利用百分比情况
import wmi import time c = wmi.WMI() while True: for cpu in c.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)
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/8287.html