Re: process and spinning slash
- From: "Fredrik Lundh" <fredrik@xxxxxxxxxxxxxx>
- Date: Sun, 30 Oct 2005 18:14:03 +0100
Alex Martelli wrote:
> Have the spin function accept the pid argument and exit the loop if said
> pid has terminated; to check the latter, e.g., os.kill(pid, 0) -- this
> will raise an OSError if no process with that pid exists, so you can use
> a try/except OSError: to catch that and break as appropriate.
or use the subprocess module instead of fork/exec, pass the Popen instance
to spin, and use the poll() method to check if the process is still running.
</F>
.
- Follow-Ups:
- Re: process and spinning slash
- From: Alex Martelli
- Re: process and spinning slash
- References:
- process and spinning slash
- From: benz
- Re: process and spinning slash
- From: Alex Martelli
- process and spinning slash
- Prev by Date: process and spinning slash
- Next by Date: Problem with py2exe
- Previous by thread: Re: process and spinning slash
- Next by thread: Re: process and spinning slash
- Index(es):
Relevant Pages
|