如何自定义jupyter notebook的主题

临时性的改变一个jupyter的主题

参考这个实现,只要在notebook里运行这段代码就行了,能让所有的cell都能够显示黑色背景

一个更为完备的工具

参考这个方案

安装jupyter-themer

然后执行jupyter-themer命令

jupyter-themer -c monokai

只要重启ipython notebook 就可以了

想要换回原来的默认值,执行

jupyter-themer

不加任何参数就行了

值得注意的是要是想让这些修改生效,要把.ipython文件夹下的以前的文件给删除掉

.ipython文件夹是ipython的配置文件,详细介绍可以参考这里,他基本在用户文件夹下

如果不小心吧整个文件夹都删除了,可能无法打开ipython notebook,这个时候只要执行下面的命令就行了

ipython profile create [profilename]

另附如何为cell添加行号:

https://stackoverflow.com/questions/20197471/how-to-display-line-numbers-in-ipython-notebook-code-cell-by-default/20197878

原文地址:https://www.cnblogs.com/wybert/p/5030697.html