3 ms·
Check out psutil (http://code.google.com/p/psutil/ http://code.google.com/p/psutil/). I discovered it the other day when I needed to get a list of open ports us
by pault 15y ago
Check out psutil (http://code.google.com/p/psutil/ http://code.google.com/p/psutil/). I discovered it the other day when I needed to get a list of open ports used by an ssh client running in a subprocess, and it was as easy as this:
sshc = psutil.Process(pid)
sshc.get_connections()
It allows you to upconvert process ids, and it has its own wrapper of Popen that returns Process objects. It also seems to have well thought out windows compatibility, if that matters to you.
:D <- My face when I found it.