Exiting Python Debugger ipdb

后端 未结 6 1034
被撕碎了的回忆
被撕碎了的回忆 2020-12-25 11:15

I use ipdb fairly often in a way to just jump to a piece of code that is isolated i.e. it is hard to write a real script that uses it. Instead I write a minimal tes

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-25 11:31

    The following worked for me:

    import sys
    sys.exit()
    

    On newer versions of ipython, as mentioned above and below, this doesn't work. In that case,

    import os
    os._exit(0)
    

    should still do the trick.

提交回复
热议问题