Basic use of Jupyter Lab

The previous tutorial has demonstrated how to install Jupyter Lab. This tutorial mainly introduces the basic use of Jupyter Lab!

1. Start Jupyter Lab

Enter the jupyter lab command in the terminal:

If you have set up Jupyter Lab to start automatically at boot, then if you run Jupyter Lab in the terminal again, it will be assigned a different port number (such as IP: 8889, etc.). It is recommended that you access Jupyter Lab directly according to IP: 8888;

Example: The Raspberry Pi IP is 192.168.93. After starting jupyter lab, you can enter 192.168.93:8888 on a device on the same LAN or in the local browser to access jupyter lab.

image-20231219094538423

2. Introduction to Jupyter Lab interface

English interface

image-20231214201146644

Chinese interface

image-20231214201913867

How to Chineseize the interface

Use pip to install the Chinese interface and enter the following command in the terminal:

image-20231219094802776

After the installation is complete, restart jupyter lab, then select "Settings → Language → Chinese Simplified" and reload the page.

image-20231214202350753

3. HelloWorld

Write and run the HelloWorld program.

Right-click the file browser menu bar, select "New Notebook File (New Notebook)", select Python3 for the kernel, and then rename it to HelloWorld

image-20231214203031992

image-20231214203217379

Code block

Select the following positions to add code blocks up or down

image-20231214203336046

Write code

image-20231214203651399

Run code

image-20231214203717232

Code block description

The content in [ ] on the left side of the code block has two states: * and number

*: Indicates that the code block is still running

Number: represents the order in which code blocks are executed

image-20231214203938608

Precautions

If you want to reset or abnormal problems occur while the code is running, you can do the following: restart all cores and clear all code block output.

image-20231214204515594