I wondered if it is possible to access variables local to the function running at the time ctrl-C interrupts the flow. Example, where main() is running when ctrl-C is pressed:
def main(myInfo):
signal.signal(signal.SIGINT, KeyboardBreak)
reportOut(myInfo)
def KeyboardBreak(signum, frame):
reportOut(myInfo)
def reportOut(myInfo):
print myInfo
I would like reportOut() to run whether main() gets all the way down to where it calls reportOut(), or the flow is interrupted.