I am writing a "post_execute" event handler that looks something like this:
class MyEventHandler(object):
    def __init__(self, ip):
        self.shell = ip
        
    def post_execute(self):
        ec = self.shell.execution_count
        print("post execute: \nIn = %s\nOut = 
%s"%(self.shell.user_ns["In"][ec], self.shell.user_ns["Out"].get(ec, None)))

def load_ipython_extension(ip):
    eh = MyEventHandler(ip)
    ip.events.register("post_execute", eh.post_execute)

It works as expected when a cell runs successfully. However, when a cell 
fails with an exception, I could not find any way to get to the stack-trace 
that was generated. Is this possible somehow?

Thank you in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/4937f1ad-2491-46e2-a9b7-aa2dcc2f2e54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to