Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ipython3 notebook vertical margin/marker line at 80 characters

  1. How to make ipython3 notebook show a vertical margin/marker line at 80 characters ?
  2. How to get i-bar location in ipython3 notebook ? (e.g. line 30 character 56)

These features assist in writing codes complying with PEP8. These features are available in Spyder.

Update 1: What I want is a vertical margin/marker line as shown in modified screenshot of the spyder. The other feature I am looking forward to is identification of location of i-bar. These two features are marked in the attached picture.

A similar solution is also okay. Modified screenshot of spyder

update 2: I did not find anything like this on the internet.

update 3: Jupyter Lab has a ruler setting (Sept 2020), details provided in the answer

like image 707
Neeraj Hanumante Avatar asked Apr 01 '16 09:04

Neeraj Hanumante


People also ask

How do you show the line numbers in Jupyterlab?

You can enable row numbers in all code cells by pressing Shift + L while no cell is active. If you cannot remember these hotkeys, open the command palette by pressing Control + Shift + P and search for 'line numbers'.

How do you show lines in a Jupyter Notebook?

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.

How do you bold lines in a Jupyter Notebook?

Use the following code to emphasize text: Bold text: __string__ or **string** Italic text: _string_ or *string*

What is the distinction between ## and in a Markdown cell?

Use the number sign (#) followed by a blank space for notebook titles and section headings: # for titles. ## for major headings. ### for subheadings.


1 Answers

This is Sept 2020. Version 2.2.8 of Jupyter Lab is available.

Answer 1: It provides a facility of a ruler in the Settings > Advanced Settings Editor. Answer by https://stackoverflow.com/a/55035981/6646912 gives general guidance on how to edit the settings. In particular, the following preferences can be included:

{
    "codeCellConfig": {
                        "rulers": [80],
                        "wordWrapColumn": 80,
                      },
}

Answer 2: Location of i-bar is also available in Jupyter Lab

like image 148
Neeraj Hanumante Avatar answered Oct 10 '22 21:10

Neeraj Hanumante