subprocess.Popen

Keith Dart kdart at kdart.com
Sun Dec 12 19:03:08 EST 2004


Michele Simionato wrote:
> I was looking at Python 2.4 subprocess.Popen. Quite nice and handy, but I
> wonder why a "kill" method is missing. I am just adding it via subclassing,
> 
> class Popen(subprocess.Popen):
>     def kill(self, signal = SIGTERM):
>         os.kill(self.pid, signal)
> 
> but I would prefer to have it in the standard Popen class. I am surprised
> it is not there. Any comments?

Probably because it is not entirely portable. If you want a more 
complete, but Posix-only (at least Linux and FreeBSD), process 
management and spawning then you can use the proctools module in pyNMS.

http://sourceforge.net/projects/pynms/





-- 
                            \/ \/
                            (O O)
-- --------------------oOOo~(_)~oOOo----------------------------------------
Keith Dart <kdart at kdart.com>
vcard: <http://www.kdart.com/~kdart/kdart.vcf>
public key: ID: F3D288E4       URL: <http://www.kdart.com/~kdart/public.key>
============================================================================



More information about the Python-list mailing list