python - Saving program state when user invokes Ctrl-C -


in python, when user invokes ctrl-c, happens? have possibility save program state?

what context-managers? __exit__() section executed?

basically, keyboardinterrupt exception raised inside main thread. yes, can handle catching in try/except block , __exit__() sections executed

https://docs.python.org/2/library/exceptions.html#exceptions.keyboardinterrupt


Comments

Popular posts from this blog

c++ - list<myClass<int> * > sort -

c - Defining floating point constants, how many digits are useful? -

C# Apple Bonjour - how to monitor service records within Windows -