Showing line numbers in IPython/Jupyter Notebooks

后端 未结 10 1183
遥遥无期
遥遥无期 2020-12-04 05:56

Error reports from most language kernels running in IPython/Jupyter Notebooks indicate the line on which the error occurred; but (at least by default) no line numbers are in

相关标签:
10条回答
  • 2020-12-04 06:35

    For me, ctrl + m is used to save the webpage as png, so it does not work properly. But I find another way.

    On the toolbar, there is a bottom named open the command paletee, you can click it and type in the line, and you can see the toggle cell line number here.

    0 讨论(0)
  • 2020-12-04 06:35

    You can also find Toggle Line Numbers under View on the top toolbar of the Jupyter notebook in your browser. This adds/removes the lines numbers in all notebook cells.

    For me, Esc+l only added/removed the line numbers of the active cell.

    0 讨论(0)
  • 2020-12-04 06:38

    CTRL - ML toggles line numbers in the CodeMirror area. See the QuickHelp for other keyboard shortcuts.

    In more details CTRL - M (or ESC) bring you to command mode, then pressing the L keys should toggle the visibility of current cell line numbers. In more recent notebook versions Shift-L should toggle for all cells.

    If you can't remember the shortcut, bring up the command palette Ctrl-Shift+P (Cmd+Shift+P on Mac), and search for "line numbers"), it should allow to toggle and show you the shortcut.

    0 讨论(0)
  • 2020-12-04 06:42

    Select the Toggle Line Number Option from the View -> Toggle Line Number.

    The menu looks like this

    0 讨论(0)
提交回复
热议问题