我喜欢黑暗题材。但是,Jupyter笔记本的默认主题是浅色,我找不到更改主题/背景色的选项。这是怎么做到的?
当前回答
你可以直接在打开的笔记本上完成:
!pip install jupyterthemes
!jt -t chesterish
重新启动主题应用程序的jupyter服务器
其他回答
使用FireFox插件“暗黑木星”。
而不是在Jupyter内部安装一个库,我建议你使用Chrome中的“黑暗阅读器”扩展(你可以在其他浏览器中找到“黑暗阅读器”扩展,例如Firefox)。 你可以玩它;过滤URL(s)你想有黑暗主题,甚至如何定义黑暗主题为自己。 下面是几个例子:
我希望这能有所帮助。
!pip install jupyterthemes
运行这个库:
from jupyterthemes import get_themes
import jupyterthemes as jt
from jupyterthemes.stylefx import set_nb_theme
这:
set_nb_theme('monokai')
主题:
’monokai’, ’chesterish’, ’oceans16’, ’solarizedl’, ’solarizedd’, ’grade3’, ’onedork’
简单,Jupyter字体大小和内外背景颜色的全局更改(此更改将影响所有笔记本电脑)。
在Windows下,通过运行命令找到config目录: jupyter——config-dir
在Linux中是~/.jupyter
在此目录中创建子文件夹custom 创建文件custom.css并粘贴:
/* Change outer background and make the notebook take all available width */
.container {
width: 99% !important;
background: #DDC !important;
}
/* Change inner background (CODE) */
div.input_area {
background: #F4F4E2 !important;
font-size: 16px !important;
}
/* Change global font size (CODE) */
.CodeMirror {
font-size: 16px !important;
}
/* Prevent the edit cell highlight box from getting clipped;
* important so that it also works when cell is in edit mode */
div.cell.selected {
border-left-width: 1px !important;
}
最后,重启Jupyter。结果:
另一个选择是如果你使用谷歌chrome,想要一个黑暗的主题,让你在jupyter/网页上工作几个小时更容易,同时也让你的代码中的配色方案可读,那就是在实验中使用“Web内容的自动暗模式”标志- chrome://flags -我通常会选择“启用选择性图像反转”选项。
推荐文章
- 如何知道哪个Python在Jupyter笔记本上运行?
- 使用Python 3在Jupyter Notebook中使用相对导入从位于另一个目录中的模块导入本地函数
- 如何在编辑器(Atom, notepad++, Kate, VIM, Sublime, Textpad等)和ide (NetBeans, IntelliJ IDEA, Eclipse, Visual Studio等)中选择列
- 使用Emacs递归地查找和替换尚未打开的文本文件
- 如何嵌入HTML到IPython输出?
- 如何使Sublime Text成为Git的默认编辑器?
- 禁止在vim中创建交换文件
- 如何从终端运行。ipynb Jupyter Notebook ?
- 移除jupyter笔记本上的内核
- 基于gui或基于web的JSON编辑器,工作方式类似于属性浏览器
- 如何加载/编辑/运行/保存文本文件(.py)到IPython笔记本细胞?
- 如何改变AlertDialog的主题
- notepad++是否显示所有隐藏字符?
- 在安装pip后,“jupyter:命令未找到”
- 在IPython中自动重载模块