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 notebook
command on the command line and a browser window will pop up automatically to open Jupyter Notebook, as shown below.
Then click Nbextensions
the option, the following interface will appear, and then remember to cancel the checkmark option above.
At this point, you can check the corresponding extension function
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
4 jupyter notebook interface introduction
5 shortcut key operation
-
Common shortcut keys for both modes
Shift+Enter
, execute the code of this unit, and jump to the next unitCtrl+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 cellZ
,go backL
, 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 by
Tab键
-
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)
- Multi-cursor operation:
-
6 markdown demo
Master headings and indentation