Alex
Alex

Reputation: 1371

how to break out of ipdb debugger?

How do you exit the ipdb debugger? According to this question typing q should just work. I am on Python 3.6.6, Ipython 6.4.0 and that does not work in the following context: I have a function, f(x), that is called from another function in a loop. After 2 iterations I just want to stop evaluation and exit the debugger. My f(x) just looks like this:

def f(x):
    ipdb.set_trace()

Literally meant to allow me to inspect x at runtime. However, typing q does not exit the debugger. Typing os._exit(0) kills the kernel. There must be something better? This is within a jupyter notebook.

Upvotes: 2

Views: 1549

Answers (1)

Madtasmo
Madtasmo

Reputation: 21

as i remember this used to be a bug in IPython 5.1, you can try Ctrl+d to exit the debugger, or quit(), or you can use Ctrl+z.

Last thing you can try is Ctrl+c.

Upvotes: 2

Related Questions