subprocess.Popen

Peter Hansen peter at engcorp.com
Sun Dec 12 15:01:33 CET 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?

Likely this is at least part of the answer:

c:\>python
Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on 
win32
 >>> import os
 >>> os.kill
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute 'kill'


Note the "on win32" part above...

-Peter



More information about the Python-list mailing list