Hamzeh Alsalhi
Hamzeh Alsalhi

Reputation: 473

Is there a ipython server pre shutdown hook?

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

Answers (1)

vbraun
vbraun

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

Related Questions