It is a good idea to catch and re-raise KeyboardInterrupts, so that you can even now eliminate This system working with Ctrl-C. Logging is outside the house the scope of the question, but a good choice is logging. Documentation for your sys and traceback modules. You want the traceback module. https://helpmehigh.com/