已经习惯在jupyter notebook上开发程式,但常常还是有很多重複性的操作,使人觉得厌烦,来介绍 Jupyter notebook extensions,让你专注在code上,其他的事就交给extensions吧!
安装:
pip install jupyter_contrib_nbextensions && jupyter contrib nbextension install
此时你的jupyter notebook就多了nbextensions tab
enable你要的插件,我的选择如下:
Autopep8,神器!依据PEP8自动排版(required $pip install autopep8)Snippets,神器之二!可以自订常用的snippet cell来一键引入Move selected cells,快捷上下移动cell,(Alt-up、Alt-down)Table of Contents (2),程式码大纲,让较大的专案可以一目了然Hide Header,收缩工具列(Ctrl+H)Code folding,折叠程式码Collapsible Headings,折叠章节zenmode,隐藏标题、工具列、增添背景,打造环境,让你专注在程式码想更改插件参数,一开始就进anaconda目录里面找,发现怎么改也没用,google才知道改错了伺服器对应的资料夹档案,可以输入指令来找到对应资料夹。
jupyter --path
像我就在C:\ProgramData\jupyter中改动成功。
\snippets\snippets.json #修改以增加引入项目
\zenmode\images可以自订背景,另外main.js也要改!
最后利用jupyter themes来修改主题颜色,附上我的设定以供参考
pip install --upgrade jupyterthemesjt -t onedork -f roboto -fs 14 -nfs 14 -tfs 14 -ofs 11 -T
参数请见官网