0

To get all the process list im using Windows Management Instrumentation (WMI),and code is :

import wmi
c = wmi.WMI ()

for process in c.Win32_Process ():
  print process.ProcessId, process.Name

But my question is how could i find the process which utilizes maximum CPU resource ?

Tharif
  • 13,794
  • 9
  • 55
  • 77

1 Answers1

0

I would suggest rather than using WMI which is windows specific use psutil which is cross platform, then you can use the process class cpu_percent() method.

Steve Barnes
  • 27,618
  • 6
  • 63
  • 73