我喜欢黑暗题材。但是,Jupyter笔记本的默认主题是浅色,我找不到更改主题/背景色的选项。这是怎么做到的?


当前回答

您可以使用运行笔记本中的set_nb_theme更改主题

!pip install jupyterthemes

from jupyterthemes import get_themes
import jupyterthemes as jt
from jupyterthemes.stylefx import set_nb_theme

set_nb_theme('chesterish')

从https://www.kaggle.com/getting-started/97540粘贴

其他回答

遵循以下步骤

使用pip安装jupyterthemes:

pip install jupyterthemes

然后从下面选择主题,并使用以下命令设置它们。一旦成功安装,我们中的许多人认为我们需要再次启动jupyter服务器,只需刷新页面。

使用以下命令设置主题:

jt -t <theme-name>

可用的主题:

onedork grade3 oceans16 chesterish monokai solarizedl solarizedd

可用主题的截图在其Github存储库中。

在设置主题时,还可以在同一个命令中指定-T(——toolbar)来保留工具栏,否则工具栏将不显示。如需帮助,请输入jt -h。

使用Kyle Dunovan的jupyter-themes包很容易做到这一点。您可以使用conda安装它。否则,您将需要使用pip。

使用conda安装:

conda install -c conda-forge jupyterthemes

或小毛病:

pip install jupyterthemes

你可以通过以下方法获得可用主题的列表:

jt -l

所以改变你的主题:

jt -t theme-name

要加载主题,最后,重新加载页面。文档和源代码都在这里。在设置主题时,还可以在同一个命令中指定-T(——toolbar)来保留工具栏,否则工具栏将不会显示。如需帮助,请输入jt -h。

而不是在Jupyter内部安装一个库,我建议你使用Chrome中的“黑暗阅读器”扩展(你可以在其他浏览器中找到“黑暗阅读器”扩展,例如Firefox)。 你可以玩它;过滤URL(s)你想有黑暗主题,甚至如何定义黑暗主题为自己。 下面是几个例子:

我希望这能有所帮助。

你可以按照这些步骤来做。

PIP install jupyterthemes或PIP install——upgrade jupyterthemes以升级到最新版本的主题。 然后列出所有的主题:jt -l 在jt-t <themename>之后,例如jt-t solarizedl

您可以使用运行笔记本中的set_nb_theme更改主题

!pip install jupyterthemes

from jupyterthemes import get_themes
import jupyterthemes as jt
from jupyterthemes.stylefx import set_nb_theme

set_nb_theme('chesterish')

从https://www.kaggle.com/getting-started/97540粘贴