Starting python debugger automatically on error

前端 未结 13 2269
南方客
南方客 2020-11-27 08:44

This is a question I have wondered about for quite some time, yet I have never found a suitable solution. If I run a script and I come across, let\'s say an IndexError, pyth

13条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-27 09:29

    Put a breakpoint inside the constructor of topmost exception class in the hierarchy, and most of the times you will see where the error was raised.

    Putting a breakpoint means whatever you want it to mean : you can use an IDE, or pdb.set_trace, or whatever

提交回复
热议问题