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

javascript - Hide toolbar of pdf file opened inside iframe using firefox -

Copy range with conditional formatting -

Ansible - ERROR! the field 'hosts' is required but was not set -