# IPython和Jupyter的使用 1. Ipython使用 a. 启动 - 命令行输入 `ipython`即可启动 - 退出:`exit`或者 `Ctrl+D` - 帮助:`?`或者 `help` b. 基本操作 ![1701138670033](image/ipython_jupyter/1701138670033.png) 2. Jupyter使用 a. 启动 - 命令行输入 `jupyter notebook`即可启动 - 退出:`Ctrl+C` - 帮助:`?`或者 `help` - 重启:`Ctrl+C`后输入 `jupyter notebook` - 重启后,之前打开的文件会丢失,需要重新打开 b. 本地远程访问Linux服务器上的 `jupyter notebook` - 首先激活服务器上要使用的python环境(最好使用Anaconda)。 - 输入"`jupyter notebook --no-browser`",在不弹出浏览器的情况下启动jupyter notebook服务。 ![图中报错可以忽略](image/ipython_jupyter/1701169934196.png) * **SSH端口转发实现本地访问** * 本地输入:`ssh -N -f -L localhost:8888:localhost:8888 gn@10.7.39.230` ![1701170051281](image/ipython_jupyter/1701170051281.png) * 本地浏览器中输入:`http://localhost:8888/tree?token=7a3d9a7118bd3be8a20c4816526dc369905b8fcc2134aa6b` * * 至此即可在本地远程打开服务器的jupyter notebook文档。