Thanks, filed an issue here: https://github.com/ipython/ipython/issues/10702

If you are able to provide me with some high-level guidance on how to 
implement this feature in run_cell, I will be more than happy to send a PR 
with the changes. For my own use-case, I don't need any changes to 
HistoryManager. In fact, I can just store an additional field parallel to 
last_execution_succeeded. However, I don't know if this is necessarily the 
best long-term option.

Please let me know and thanks again for your help.

On Friday, July 14, 2017 at 10:14:30 AM UTC-4, takowl wrote:
>
> I don't think it's currently possible. Do you want to file an issue on 
> ipython/ipython to request it?
>
> On 13 July 2017 at 22:05, Sudarshan Raghunathan <rdar...@gmail.com 
> <javascript:>> wrote:
>
>> 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 jupyter+u...@googlegroups.com <javascript:>.
>> To post to this group, send email to jup...@googlegroups.com 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jupyter/4937f1ad-2491-46e2-a9b7-aa2dcc2f2e54%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jupyter/4937f1ad-2491-46e2-a9b7-aa2dcc2f2e54%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/ae7140b9-2d64-4156-9f4f-77dd3f5bce02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to