Questions tagged [psutil]

psutil (python system and process utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network) in Python.

psutil (process and system utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network) in Python. It is useful mainly for system monitoring, profiling and limiting process resources and management of running processes. It implements many functionalities offered by command line tools such as: ps, top, lsof, netstat, ifconfig, who, df, kill, free, nice, ionice, iostat, iotop, uptime, pidof, tty, taskset, pmap. It currently supports Linux, Windows, OSX, Sun Solaris, FreeBSD, OpenBSD and NetBSD, both 32-bit and 64-bit architectures, with Python versions from 2.6 to 3.5.

Resources:

481 questions
-1
votes
1 answer

How can I get live established UDP connections with python using psutil

I am trying to get the destination IP (remote host) addresses connected to my machine that are using UDP protocol but i get Null results using psutil the script I wrote import psutil def GetServerIP(): PROCNAME = "theprocessname.exe" for…
-1
votes
1 answer

Error when installing psutil module - [Windows pypy 2.7]

Trying to install module "psutil" I'm usting Windows 10 and pypy 2.7 version https://pypy.org/download.html pypy -m pip install psutil DEPRECATION: A future version of pip will drop support for Python 2.7. More details about Python 2 support in…
-1
votes
1 answer

python psutil.net_io_counters() returning invalid results

I'm using psutil library to obtain some system network information. Unfortunately it seems the values I'm getting are in-correct. I know for a fact that the bytes received and sent on ethernet 4 is not 556MB/71MB. When I view performance from task…
tyleax
  • 1,556
  • 2
  • 17
  • 45
-1
votes
1 answer

Can only find disk letters inside IDLE

I've written a python script that finds disk letters and it uses psutil. When I run this script from command prompt it says: ModuleNotFoundError: No module named 'psutil' but it runs perfectly when I run it from IDLE. I tried to upgrade psutil but…
Wyren
  • 117
  • 1
  • 4
  • 16
-1
votes
3 answers

Using python how to display dns

Using Python, is there a way using psutil or something else to return the output of "ipconfig /displaydns" or something similar? Spawning a cmd process and running the command is not an option.
user1314011
  • 153
  • 2
  • 5
  • 12
-1
votes
1 answer

python making a live output of cpu usage

So I would like to make a python program that displays the computers cpu usage in real time. So far I am using the psutil module to find cpu usage but I'm not sure how to represent the output visualy. import psutil x=(2) while x>0: cpu =…
Prof101
  • 59
  • 1
  • 8
-1
votes
2 answers

shifting elements in fixed sized list

I have a list with fixed size of 10 which i will put CPU percent of my computer with 2 seconds of interval. What i'm trying to do is, removing 1st element shifting each element into previous index of list recording 11th value at last index of…
t1w
  • 1,408
  • 5
  • 25
  • 55
-1
votes
1 answer

Psutil 'Process' object has no attribute 'terminal'

Ok so I started using psutil 2.1.1 with Python 2.7.6 and I wanted to test some commands as follows: import psutil psutil.pids() p = psutil.Process(6096) p.name() # gives u'googletalk.exe' p.terminal() These are the commands I used from the psutil…
-1
votes
1 answer

python system idle/inactive without using ctypes - platform independent as well

I was wondering if it is possible to detect if system is idle using psutil (https://code.google.com/p/psutil/). I want to be able to trigger something if there is no system wide activity for a few seconds. I have some *trouble using the…
R.W
  • 530
  • 1
  • 12
  • 34
-2
votes
2 answers

No module named 'psutil', although it is installed (MacOS)

When I run my code that includes psutil module I encounter the following error: Traceback (most recent call last): File "/Users/alek/Desktop/coloring/solver.py", line 4, in from psutil import cpu_count ModuleNotFoundError: No module…
catfood
  • 1
  • 3
-2
votes
2 answers

How to get RAM and CPU time consumption ? Python App on Linux

I'm trying to get the value of the CPU consumption and the RAM consumption of my Python App on a Linux embedded environnement using Psutil and Memory_Profiler. The thing is I can't get it done, or more accurately I think I don't understand exactly…
Lalastro
  • 151
  • 2
  • 10
-2
votes
2 answers

How to receive real time logs from PID's in terminal?

I have a computational program written in Python using Ray package with the following output: Actor(Play001,69a6825d641b461327313d1c01000000) This process uses the following pid: pid = 87972 In the Ray dashboard I can view the logs. Snippets is…
-2
votes
1 answer

Python List Comprehension for More Complex Loops

I use list comprehension for simple loops. But I could't use list comprehension for the following code. How can I do it? import psutil list1 = [] for pr in psutil.process_iter(): with pr.oneshot(): list1.append([pr.name(),…
oduncu90
  • 45
  • 8
-2
votes
1 answer

How to get CPU utilisation in python?

Currently i use psutil for getting RAM percentage print (' ') print ('----------------------CPU Information summary----------------------') print (' …
Sashank
  • 557
  • 6
  • 20
-3
votes
2 answers

psutil and resource library output to file parse the file using regex and get the number

I used psutil and resource library and print the output to a file, the output of the text file given below: image of the output file before argument parser: svmem(total=13653602304, available=12436942848, percent=8.9, used=916492288,…
1 2 3
32
33