murphytalk's digitized memo
  • Computer
  • Archives

Add line number in Jupyter Notebook code cell by default

Date Thu August 04 2016 Tags python

Select a code cell, open browser’s JavaScript console, type and execute the following lines:

var cell = Jupyter.notebook.get_selected_cell();
var config = cell.config;
var patch = {
    CodeCell:{
        cm_config:{lineNumbers:true}
    }
}
config.update(patch)

Then reload the page. These changes will be saved in .jupyter/nbconfig. See Configuring the notebook frontend.


Tags

  • devops 1
  • python 2
  • Jupyter 1
  • Pandas 1
  • DayDream 1
  • ChatOps 1
  • anki 1
  • bot 1
  • CoffeeScript 1
  • scheme 2
  • lisp 2
  • SICP 1
  • Windows 1
  • Linux 1
  • English 1

Links

    •    My Knowledge Base
    •    My Private Diary
    •    My Online Portal
  • Recent Posts

    • 2019-01-15   Mattermost: a promising alternative to Slack ?
    • 2016-08-04   Add line number in Jupyter Notebook code cell by default
    • 2016-07-13   Pandas 101
    • 2016-06-30   A piece of old software of mine
    • 2016-06-22   ChatOps with Hubot - Anki automation
    • 2015-03-29   Learning Scheme - atom, list and S-expression
    • 2015-03-28   Learning Scheme - setup the environment
    • 2014-06-29   Solved : Windows cannot sleep on a Windows/Linux dual boot PC
    • Archives

    © 2019 Mu Lu · Powered by pelican-bootstrap3, Pelican, Bootstrap

    Creative Commons License Content licensed under a Creative Commons Attribution-NonCommercial 4.0 International License, except where indicated otherwise.

    Back to top