pythonjupyter-lab

Is there a way to show which line of a cell is being proccesed in Jupyter Lab?


I want to know if there's a way to show an indicator or something that tells me at which line my Jupyter Lab code is while executing. Google Colab does this with a little green arrow next to the line (see image below), and I'm wondering if there's something similar for JL.

Indicator in Google Colab


Solution

  • Not quite like the way that corporation adapted the open source product, but some of these options may get you to what you want....

    JupyterLab lets you attach a console to monitor everything as it runs.
    You want to make show you activate Show All Kernel Activity. See here, here, and here. See more about JupyterLab's code console in the documentation here.
    Now that doesn't quite still do what you want, but you can add a shortcut that lets you specify lines to run to allow you to narrow the running code to what you specify. See 'Feature Request - Ability to Split and Independently Execute Sections of a Single Cell'.

    Alternatively...
    It's not the same thing, but related. You can use the Visual Debugger built into JupyterLab to step through the callstack after you set at least one breakpoint. It will show the variable values as they change. See here for more about how it relates to what you'd like to do, and the official documentation for the Visual Debugger is here.


    Documenting related posts beyond references in this reply:

    Also Related: