atexit handlers - getting the return code

Mike Hull mikehulluk at googlemail.com
Tue Sep 27 13:54:10 CEST 2011


Hi,
I work in neuroscience modelling and use python for lots of my work.
One problem I have is management of scripts and results. To that end,
I have
written code that make its easier to keep track of scripts, to see
which ones
have run, or need to be rerun, to see output errors and generally
organise running of scripts better.

The way i have implemented it is that I register a function to the
atexit module,
which takes care of recording information about the script run; such
as whether an
exception was raised and not caught, and how long it took to run and
the
stdout/stderr streams; which can then be uploaded into a database.

One thing I am struggling to get though is the 'return code' that the
is going to be returned after my
atexit handlers have finished. Could anyone tell me how it get at
this!?


Thanks


Mike




More information about the Python-list mailing list