Detect hung apps spawned from python

David Stubbs david at
Mon Jun 2 17:00:25 CEST 2003


I was a bit vague. I do use os.listdir() to build up the list. I meant that
I execute a script from within each of these directories with the
os.system() call. As the call to os.system() is blocking, I'd like some way
to detect if the spawned process hangs, and if so recover control.

Does anyone know an easy way of traversing a list of python scripts,
executing each one in turn, checking the return value, and also safeguarding
against scripts that never return control back to the host script?

I'm just trying to create a simple test harness, and so far have it looking
quite good except that if one of the individual tests crash then my test
harness sits patiently waiting forever, which obviously isn't good as it
then requires user intervention.

Thank again,

"Just" <just at> wrote in message
news:just-8F68BC.16435002062003 at
> In article <3edb494b$0$12997$afc38c87 at>,
>  "David Stubbs" <david at> wrote:
> > I have a python app that builds a list of all subdirectories from the
> > current directory, and then in turn runs a '' script from within
> > of these directories. I currently do this using os.system().
> Sorry for not answering your question, but have you considered
> os.listdir() and os.path.isfile()?
> Just

More information about the Python-list mailing list