I am wanting to get a list of all the process names, CPU, Mem Usage and Peak Mem Usage. I was hoping I could use ctypes. but I am happy to hear any other options. Thanks for your time.
You can use
For example, to obtain the list of process names:
process_names = [proc.name for proc in psutil.process_iter()]
Note that psutil works with Linux, OS X, Windows, Solaris and FreeBSD and with python 2.4 through 3.3.
Note that on newer versions of
psutil (>= 2) the
Process class has a
name method instead of a property and thus you should use:
process_names = [proc.name() for proc in psutil.process_iter()]