Can you write interrupts in python which can trigger and break program flow as a result of some external event?
In particular suppose you have a thread doing a computation, you want that computation to break and divert program flow to some function if an external event happens. It could complete the operation of the current line but afterward program flow should be directed to another python function.