Killing children
Laura Conrad
lconrad at laymusic.org
Fri Aug 6 17:15:13 EDT 2004
>>>>> "Peter" == Peter Hansen <peter at engcorp.com> writes:
Peter> Laura Conrad wrote:
>> p = os.spawnl(os.P_NOWAIT, "/usr/bin/python", "python", "hobo.py", '/dev/ttyS0', 5)
>> print p
>> os.system("ps")
>> time.sleep(60)
>> os.system("kill %d" % p)
Peter> This suggests that you believe the return value from os.spawnl() is
Peter> actually the PID. Unfortunately that doesn't appear to be the case
Peter> on Windows. See the note in the doc-string for my code sample from
Peter> the previous post (on Windows spawn* actually returns a "handle",
Peter> not the PID itself, and apparently turning the one into the other
Peter> is non-trivial).
So you think os.kill(p) might be the way to kill it? But does anyone
know how to get it started right?
--
Laura (mailto:lconrad at laymusic.org , http://www.laymusic.org/ )
(617) 661-8097 fax: (501) 641-5011
233 Broadway, Cambridge, MA 02139
More information about the Python-list
mailing list