Jupyter notebook installation and extended function configuration

1 installation command

# 安装jupyter
pip install jupyter 
# 安装jupyter_contrib_nbextensions库
python -m pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user --skip-running-check
#安装自动规范代码功能依赖包
pip install autopep8

2 Check the corresponding extended function option

If the above installation is OK, enter the following jupyter notebookcommand on the command line and a browser window will pop up automatically to open Jupyter Notebook, as shown below.

insert image description here
Then click Nbextensionsthe option, the following interface will appear, and then remember to cancel the checkmark option above.
insert image description here

At this point, you can check the corresponding extension function
insert image description here

3 Create a new notebook document

The default URL of the local notebook is: http://localhost:8888

If you want the notebook to open the specified directory, just enter the directory and execute the command
insert image description here

4 jupyter notebook interface introduction

insert image description here

5 shortcut key operation

  • Common shortcut keys for both modes

    • Shift+Enter, execute the code of this unit, and jump to the next unit
    • Ctrl+Enter, execute the code of this unit and stay in this unit
  • Command mode : press ESC to enter

    • Y, cell switches to Code mode

    • M, the cell switches to Markdown mode

    • A, add a cell above the current cell

    • B, add a cell below the current cell

    • Other (Understanding)

      • 双击D: delete the current cell
      • Z,go back
      • L, add the line number for the current cell <!–
      • Ctrl+Shift+P, enter the command in the dialog box to run directly
      • Quickly jump to the first cell,Crtl+Home
      • Quickly jump to the last cell, Crtl+End-->
  • Edit mode : Press Enter to enter

    • Complete code: variable, method followed byTab键

    • Add/uncomment one or more lines of code: Ctrl+/(Mac: CMD+/)

    • Other (know):

      • Multi-cursor operation: Ctrl键点击鼠标(Mac: CMD+click the mouse)
      • Fallback: Ctrl+Z(Mac: CMD+Z)
      • Redo: Ctrl+Y(Mac:CMD+Y)

6 markdown demo

Master headings and indentation
insert image description here

Guess you like

Origin blog.csdn.net/m0_56192771/article/details/124448207