Issue
I'm making an destktop application like task manager. How to get the specific cpu usage of google.exe?
Solution
You can use psutil library for your task
pip install psutil
Usage:
import psutil
chrome = None
for proc in psutil.process_iter():
if proc.name() == "chrome.exe":
chrome = proc
print(chrome.cpu_percent())
Answered By - Eugenij
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.