Launch an IPython shell on exception

前端 未结 10 2377
长情又很酷
长情又很酷 2020-12-04 09:30

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

10条回答
  •  误落风尘
    2020-12-04 09:59

    This man page says iPython has --[no]pdb option to be passed at command line to start iPython for uncaught exceptions. Are you looking for more?

    EDIT: python -m pdb pythonscript.py can launch pdb. Not sure about similar thing with iPython though. If you are looking for the stack trace and general post-mortem of the abnormal exit of program, this should work.

提交回复
热议问题