Starting python debugger automatically on error

前端 未结 13 2287
南方客
南方客 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:17

    You can put this line in your code:

    import pdb ; pdb.set_trace()
    

    More info: Start the python debugger at any line

提交回复
热议问题