How to set a breakpoint when variable changes to a certain value when debug jupyterLab?

Hi, I want to set breakpoint so that I can track how the line of code / variable value changes for each of step.

I have enabled the debug mode, and I can set the breakpoint at the line, however, is there a way that I can set the breakpoint at certain variable value?
For example, I want to pause and start debug only when variable selected is True ( if it is False, then just move on to the next hit).

Edit:
A better example of mu question is : I want the breakpoint pause when i ==7, during for loop of for i, select in enumerate(solution), how can I do that?

A similar thing I can do when using IDE is like below, and I am wondering if we can do same thing in visual debugger.

Thanks for the help!

Then why not put the break on line 16 which would be under the indented code that would be run if selected is True? Note to make the Callstack step function then work to see that detected or not, you need a first breakpoint set above the one you show so you can then select ā€˜Continueā€™ to watch what happens next when the conditional concerning selected is encountered. For example, if that code snippet shown is part of a function, then put it at the function call, run your code, and then choose ā€˜Continueā€™ to watch it either hit the next breakpoint or not, depending on what selected is. Alternatively, just put another breakpoint one or two lines above.

For clarification about what you seek, you are showing the visual debugger here. You only want answers in regard to that?

Hi @fomightez , Thanks for the quick help!

Yes, Iā€™d like answers in regard to visual debugger.
I think a better example of my question is : If want the breakpoint pause when i is 7, during for loop of for i, select in enumerate(solution), how can I do that?

A similar thing I can do when using IDE is like below, and I am wondering if we can do same hting in visual debugger.

I have updated my question. Thanks so much!

I think what you are seeking is described in this currently still open enhancement request.
You may want to add a +1 that you are still interested in this feature being added. Or if you can, try to assist getting it operational.

2 Likes

Thanks for the update! I will take a look at the enhancement :slight_smile: