@@ -0,0 +1,659 @@
+# -*- coding: utf-8 -*-%0A%0A%22%22%22%0Aexamples.kb_interrupt_handler%0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%0A%0AHandling keyboard interrupt (control+c) with%0Atry-except block.%0A%22%22%22%0A%0Aimport random%0Aimport time%0A%0Afrom yaspin import yaspin%0Afrom yaspin.spinners import Spinners%0A%0A%0Adef unpacker():%0A    sp = yaspin(Spinners.simpleDotsScrolling, right=True)%0A%0A    try:%0A        sp.start()%0A        for p in range(0, 101, 5):%0A            sp.text = %22%7B0%7D%25 Unpacking%22.format(p)%0A            time.sleep(random.random())%0A        sp.ok(%22%E2%9C%94%22)%0A    except KeyboardInterrupt:%0A        sp.color = %22red%22%0A        sp.fail(%22%E2%9C%98%22)%0A        sp.stop()%0A%0A%0Adef main():%0A    unpacker()%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add example for handling keyboard interrupt