Is there a way to launch an IPython shell or prompt when my program runs a line that raises an exception?
I\'m mostly interested in the context, variables, in the sc
You can do something like the following:
import sys from IPython.Shell import IPShellEmbed ipshell = IPShellEmbed() def excepthook(type, value, traceback): ipshell() sys.excepthook = excepthook
See sys.excepthook and Embedding IPython.