How to view cpu sweat loading on a separate process using Python?
I tried using psutil.
import psutil PROCNAME = "zoiper" for proc in psutil.process_iter(): if proc.name() == PROCNAME: a=proc.pid p = psutil.Process(a) print(p.status) print(p.cpu_percent()) print(p.cpu_affinity()) answer
<bound method Process.status of <psutil.Process(pid=8129, name='zoiper') at 140221375194168>> 0.0 [0, 1, 2, 3, 4, 5, 6, 7] Although the download is there, but it shows 0.0, maybe I'm doing something wrong?