Processing Power In Python -
this question has answer here:
- how current cpu , ram usage in python? 8 answers
is there way monitor amount of processing power used in program in python? goal kill program if using power while connecting server in case of malicious intent.
even if psutil provides os-level information in relatively os-independent way, better indicated interact directly local os. doing @ api level can seen complex , difficult debug. if case, useful alternatives in case of windows are:
wmic process list full
and
wmic path win32_perfformatteddata_perfproc_process name,percentprocessortime
that's closest windows equivalent *nix's better known ps
.
the suggestion is, then, "popen" them, , pipe output analysis. understanding @ least first (wmic process
) supports continuous mode.
Comments
Post a Comment