4 ms·
I wish someone would write an equivalent of this for Python's myriad of horrible process management functions. popen, popen2, popen3 etc were a nightmare, and t
by simonw 15y ago
I wish someone would write an equivalent of this for Python's myriad of horrible process management functions. popen, popen2, popen3 etc were a nightmare, and the newer subprocess module still doesn't have an API that I'd call memorable or obvious.
- kenneth_reitz 15y agoI am planning on this actually! HTTP lends itself well to running a process. It will likely be very call+result oriented at first (no interaction w/ a running process)
- llimllib 15y agoFor such a new module, the API for subprocess is remarkably bad. I have to look it up absolutely every time.
- pault 15y agoCheck 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.