Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show line numbers of a python notebook in Visual Studio Code

I think it should be quite straightforward, however, I cannot seem to find this option in visual studio code.

Could you tell me if it is possible and how to enable line numbers in visual studio code when coding in a python notebook?

FYI: it is possible to use visual studio code with a python notebook (you can check more info here)

like image 679
desmond13 Avatar asked May 24 '20 14:05

desmond13


People also ask

How do I show line numbers in VS Code?

On the menu bar, choose Tools > Options. Expand the Text Editor node, and then select either the language you're using or All Languages to turn on line numbers in all supported programming languages. You can also type line number in the Search box, and then choose Turn line numbers on or off from the results.

Does VS Code support Jupyter Notebook?

Jupyter Notebooks in VS Code. Jupyter (formerly IPython Notebook) is an open-source project that lets you easily combine Markdown text and executable Python source code on one canvas called a notebook. Visual Studio Code supports working with Jupyter Notebooks natively, and through Python code files.

How do you code a python in Jupyter Notebook?

To select an environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P). Once the appropriate environment is activated, you can create and run Jupyter-like code cells, connect to a remote Jupyter server for running code cells, and export Python files as Jupyter notebooks.


1 Answers

You have to press L after clicking on the left side of the code block.

Screenshot

like image 141
jhonnyfc Avatar answered Sep 27 '22 22:09

jhonnyfc