----------------------------- On Wed, Mar 18, 2015 8:43 PM CET Mark Lawrence wrote:
>On 18/03/2015 18:28, Doug Basberg wrote: >> I do real-time controls programming and I control a relay in a python >> program that must be turned off before the program ends. First, the program >> should never exit unless I do it explicitly. Is there a 'hook' to process >> before any exit (even if not expected). I must turn off that relay or harm >> may occur. Thanks, Doug >> > >https://docs.python.org/3/library/atexit.html ... But that's only for normal program termination; sys.excepthook is for unexpected exits. I would be interested to hear about a module that does both. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor