Is there a way to trigger the debugger to break, in code?

Is there a way to explicitly cause the debugger to break, in code? For instance:

if x is None:

     Debugger.break()    # or something like that

Thanks

0
1 comment

No. When you run PyCharm using "Run" and not "Debug", the debugger runtime is not attached at all. When you run PyCharm with "Debug", you can simply put a dummy statement at that place and put a breakpoint on it.

0

Please sign in to leave a comment.