官术网_书友最值得收藏!

Editing and running code

A notebook contains boxes called cells. A new notebook begins with a gray box cell, which is a text area for code editing by default. To insert and edit code: 

  1. Click inside the gray box.
  2. Type in your Python code.
  3. Click on the >| play button or press Shift + Enter to run the current cell and move the cursor to the next cell:

Cells can be run in different orders and rerun multiple times in a session. The output and any warnings or error messages are shown in the output area of each cell under each gray textbox. The number in square brackets on the left shows the order of the cell last run:

Once a cell is run, stored namespaces, including functions and variables, are shared throughout the notebook before the kernel restarts.

You can edit the code of any cells while some cells are running. If for any reason you want to interrupt the running kernel, such as to stop a loop that prints out too many messages, you can do so by clicking on the square interrupt button in the toolbar.

Try not to print too much output when using Jupyter Notebook; it may crash your browser. However, long lists will be automatically abbreviated if you print them out.
主站蜘蛛池模板: 册亨县| 松滋市| 花莲县| 余庆县| 麦盖提县| 淮北市| 乳山市| 丰都县| 富宁县| 安龙县| 盐源县| 腾冲县| 湘西| 清徐县| 怀来县| 东平县| 商河县| 五莲县| 赤峰市| 晋州市| 大厂| 韶山市| 固镇县| 定兴县| 班戈县| 辉南县| 灵川县| 金华市| 晋城| 南阳市| 长汀县| 乌什县| 罗山县| 新龙县| 苗栗市| 古蔺县| 鸡东县| 山丹县| 商都县| 金溪县| 荆门市|