This is I think what I am doing yes. My code does something like this,
W1 = start_some_widget
W2 = start_some_widget
...
Wn = start_some_widget
root.mainloop()
Some of these widgets respond to events, and this response code can
cause exceptions (for example some of the widgets do file saves). I
would like to catch all these exceptions using a single piece of
code in my "main" program. So set up something like,
exception catcher for E1, E2, ..., En
...
W1 = start_some_widget
W2 = start_some_widget
...
Wn = start_some_widget
root.mainloop()
But I suspect this is what you mean by installing an exception
handler that gets called "after the code that installed it is gone".
>This is not possible in Python. It smells of signal handling though
>-- maybe you can do something with the signal module?
What I have done is to pass each widget an error handler which the
widget calls on error, passing an exception, and args. Its not
pretty but its effective.
graham
Je suis pour le communisme
Je suis pour le socialisme
Je suis pour le capitalisme
Parce que je suis opportuniste