python交互式编辑器_Python交互式编辑器ipthon notebook jupyter

简介

IPython NoteBook(jupyter)是一个综合的交互式编程环境,比原本python命令进入的交互式环境要强大很多,总之就是炫酷加实用,浏览器中写Python代码,访问源端linux服务器。

官网链接

1、安装依赖

安装pip:

yum install epel-release

yum install python-pip python-devel

安装开发工具集:

yum groupinstall 'Development Tools'

2、安装配置Jupyter

pip install jupyter

运行:

jupyter notebook

Jupyter安装成功,但是默认配置下只能从本地访问(http://127.0.0.1:8888)。

如果你只在本机使用notebook,那么下一个步可以省了。如果你想把notebook做为公共服务供其它人使用,配置允许远程访问:

生成配置文件:

jupyter notebook --generate-config

生成的配置文件位于 ~/.jupyter/jupyter_notebook_config.py

生成自签名SSL证书:

cd ~/.jupyter

openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout notebook_cert.key -out notebook_cert.pem

生成一个密码hash:

python -c "import IPython;print(IPython.lib.passwd())"

vim ~/jupyter/jupyter_notebook_config.py

c = get_config()

c.NotebookApp.certfile = u'/home/xxxx/.jupyter/notebook_cert.pem'

c.NotebookApp.keyfile = u'/home/xxxx/.jupyter/notebook_cert.key'

c.NotebookApp.password = u'sha1:991ec9cd2f39:522598e19891bab1ecaa3a9072e71f45811af9f2'

c.NotebookApp.ip = '*'

c.NotebookApp.port = 8080

c.NotebookApp.open_browser = False

再次启动Notebook:

jupyter notebook

如果你开启了防火墙,配置打开8080端口。

使用浏览器访问:https://your_domain_or_IP:8080

截图

操作gif

使用快捷键

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值