Reputation: 473
I want to run a small bit of python code when the notebook server gets a shutdown signal, is there a hook for this in the configuration?
Upvotes: 2
Views: 950
Reputation: 1997
I don't think there is anything IPython specific. You can use the atexit module (https://docs.python.org/2/library/atexit.html) to run code before the Python interpreter quits.
Upvotes: 2