Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Listing the processes running on one's computer in Python

Is there a cross-platform way to list the processes running on one's computer through a python script? For Unix based system "ps -ef" works, but I am new to Python and don't know a way to write something that would work across any platform.

Thanks!

like image 521
Moiz Avatar asked Apr 18 '26 12:04

Moiz


1 Answers

Python itself doesn't offer any such functionality. On PyPI, there is the enumprocess package, which supposedly helps; there is also the PSI package. I haven't personally used any of them.

like image 170
Martin v. Löwis Avatar answered Apr 20 '26 01:04

Martin v. Löwis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!