使用Jupyter开发Python

191 阅读1分钟
  1. 安装jupyter

pip install jupyter

  1. 启动

jupyter notebook

打开浏览器,输入http://localhost:8888,即可开启使用jupyter了

点击顶部菜单栏的"File" -> "New" -> "Notebook",选择Python3

image.png

按住Alt+Enter可以快速执行并添加新的输入框

可以点击的按钮

image.png

image.png

需要多多探索了


  1. 帮助命令

jupyter notebook --h

  1. 配置jupyter

jupyter notebook --generate-config

此命令会在当前用户目录下的.jupyter目录下生成 jupyter_notebook_config.py 文件

# 设置默认的浏览器
c.NotebookApp.browser = 'chrome'

# 设置默认的端口号
c.NotebookApp.port = 8888

# 设置默认的首页目录
c.NotebookApp.notebook_dir = ' C:\Users\mengzh\py'

# 设置是否启用密码保护
c.NotebookApp.password = 'sha1:124578'