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