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

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

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -