psutil

How to add loop in tkinter label

How to add loop in tkinter label Question: import psutil import time from tkinter import * root = Tk() Label = Label(root, text=psutil.cpu_percent()).pack() time.sleep(1) root.mainloop() Here’s the code. Now I want to refresh the psutil.cpu_percent() after 1 sec continuously. How can I make such a loop in it? Asked By: Jahin Ahnaf || Source Answers: …

Total answers: 2

use 'pip install psutil' on docker image python:3.9.13-alpine3.16 error: linux/ethtool.h not found

use 'pip install psutil' on docker image python:3.9.13-alpine3.16 error: linux/ethtool.h not found Question: I tried to install python module psutil in docker python:3.9.13-alpine3.16 But it reported the following mistake: Building wheels for collected packages: psutil Building wheel for psutil (pyproject.toml) … error error: subprocess-exited-with-error × Building wheel for psutil (pyproject.toml) did not run successfully. │ …

Total answers: 1

Unable to import psutil on M1 mac with miniforge: (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

Unable to import psutil on M1 mac with miniforge: (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) Question: I’m using a miniforge environment on an M1 mac, and unable to import psutil: ImportError: dlopen(/Users/caspsea/miniforge3/lib/python3.9/site-packages/psutil/_psutil_osx.cpython-39-darwin.so, 0x0002): tried: ‘/Users/caspsea/miniforge3/lib/python3.9/site-packages/psutil/_psutil_osx.cpython-39-darwin.so’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64e’)), ‘/usr/local/lib/_psutil_osx.cpython-39-darwin.so’ (no such file), …

Total answers: 2

How to monitor usage of CPU when function is called in Python psutil?

How to monitor usage of CPU when function is called in Python psutil? Question: Hey I’m learning psutil package and I want to know how to display current CPU usage when function is in progress? I suppose I need some threading or something like this, but how to do it? Thank u for any answers. …

Total answers: 4

Python detect a python script's name in the list of processes

Python detect a python script's name in the list of processes Question: I know I can use psutil to get a list of running processes’ names like this import psutil for i in psutil.pids(): print(psutil.Process(i).name()) However, If i run a python script with python, psutil only will show me that I have an instance of …

Total answers: 4