基于网页开发工具Jupyter

基于网页开发工具Jupyter

七月 07, 2019

Jupyter Notebook是基于网页的用于交互计算的应用程序。其可被应用于全过程计算:开发、文档编写、运行代码和展示结果。

前提:安装完成并配置好环境

启动

打开命令行,更改到想要执行的文件夹下

在终端中输入以下命令:

1
jupyter notebook

执行命令之后,在终端中将会显示一系列notebook的服务器信息,同时浏览器将会自动启动Jupyter Notebook。

启动过程中终端显示内容如下:

1
2
3
4
5
6
7
8
9
10
11
D:\workspace>jupyter notebook
[I 16:20:40.367 NotebookApp] Serving notebooks from local directory: D:\workspace\blog\zhaoyifanBlog
[I 16:20:40.367 NotebookApp] The Jupyter Notebook is running at:
[I 16:20:40.369 NotebookApp] http://localhost:8888/?token=d6f7f5a9727a9f8e33529ec7884520e93a7583233778990f
[I 16:20:40.373 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:20:40.425 NotebookApp]

To access the notebook, open this file in a browser:
file:///C:/Users/%E7%BB%8F%E5%B9%B4/AppData/Roaming/jupyter/runtime/nbserver-1652-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=d6f7f5a9727a9f8e33529ec7884520e93a7583233778990f

在浏览器打开它给出路径即可操作

注意:之后在Jupyter Notebook的所有操作,都请保持终端不要关闭,因为一旦关闭终端,就会断开与本地服务器的链接,你将无法在Jupyter Notebook中进行其他操作啦。

新建的python文件可以单行运行(按下enter+shift)