python qtextedit设置光标位置_「N体饭」Python小课堂 - jupyter notebook更换皮肤主题

本文介绍了如何使用jupyterthemes为Jupyter Notebook更换皮肤和调整字体样式,包括不同类型的字体选择和预设的主题,如chesterish、grade3等。教程详细解释了jupyter-theme命令的参数,帮助用户自定义界面。
摘要由CSDN通过智能技术生成

「N体饭」Python小课堂

作者:许立轩

简介

分享实用、新奇、有fun的Python小知识

让您的Python功力更上一层楼吧~

jupyter notebook更换皮肤主题

您是否厌倦了jupyter notebook的默认主题呢?

您是否想过能不能让jupyter notebook的界面更加高大上一点呢?

您是否想一天换一个jupyter notebook的主题呢?

2d8a21c9a6b8cebc4c6ad1fea24a356e.png

有了jupyterthemes,我可以!

736231ecbd9d09b41e0ab2dc90830256.png

视频地址:https://www.bilibili.com/video/BV1Et4y1D7ru/

下载jupyterthemes

我们可以通过pip来安装jupyterthemes

pip install jupyterthemes

也可以通过下列命令来更新jupyterthemes到最新版本

pip install --upgrade jupyterthemes

使用jupyterthemes

那么下载完成后,我们可以在终端使用 jupyter-theme 命令来更改notebook主题

jupyter-theme -h # 查看jupyter-theme的帮助手册

您也可以通过 jupyter-theme 的命令简写 jt 来使用

jt -h # 查看jupyter-theme的帮助手册

强烈推荐第二种方式,因为懒惰是程序员的基本美德

jupyter-theme参数详解

功能介绍选项参数默认值查看帮助文档-h--展示所有的皮肤主题-l--设置安装的主题-t--设置代码字体样式-f--设置代码字体大小-fs11设置notebook的字体样式-nf--设置notebook的字体大小-nfs13设置text/md的cell字体样式-tf--设置text/md的cell字体大小-tfs13设置Pandas的DataFrame字体大小-dfs9设置输出区域的字体大小-ofs8.5设置Mathjax的字体大小(%)-mathfs100设置页面的margin外边距-mauto设置Cell的宽度-cellw980设置行高-lineh170设置光标的宽度-cursw2设置光标的颜色-cursc--Alt Prompt Layout-altp--Alt Markdown BG Color-altmd--Alt Output BG Color-altout--Style Vim NBExt*-vim--Toolbar是否可见-T--文件名和Logo是否可见-N--内核的Logo是否可见-kl--重置为默认的notebook主题-r--重置为默认的字体-dfonts--

code cells的可选字体样式

-f argMonospace FontankaAnka/CoderanonymousAnonymous ProaurulentAurulent Sans MonobitstreamBitstream Vera Sans MonobpmonoBPmonocodeCode New RomanconsolamonoConsolamonocousineCousinedejavuDejaVu Sans MonodroidmonoDroid Sans MonofiraFira MonofiracodeFira CodegenericGeneric MonohackHackhaskligHaskliginconsolataInconsolata-ginputmonoInput MonoiosevkaIosevkaliberationLiberation MonomesloMesloofficeOffice Code ProoxygenOxygen MonorobotoRoboto MonosaxmonosaxMonosourceSource Code ProsourcemedSource Code Pro MediumptmonoPT MonoubuntuUbuntu Mono

notebook与text/md cells的可选字体样式

Sans-Serif Fonts

-nf/-tf argSans-Serif FontopensansOpen SansdroidsansDroid SansexosansExo_2latosansLatoptsansPT SansrobotosansRobotosourcesansSource Sans Pro

Serif Fonts

-nf/-tf argSerif FontloraserifLoraptserifPT SerifgeorgiaserifGeorgiacardoserifCardocrimsonserifCrimson TextebserifEB GaramondmerriserifMerriweatherneutonserifNeutongoudyserifSorts Mill Goudy

jupyter-theme使用示例

# 查看所有可选主题# chesterish | grade3 | gruvboxd | gruvboxl | monokai | oceans16 | onedork | solarizedd | solarizedljt -l# 切换使用grade3主题# 一般刷新notebook页面就可以看到效果,如果没起作用的话,可能需要删除一下浏览器的缓存jt -t grade3# 重置notebook的主题,回到解放前jt -r# 默认展示工具箱以及文件名jt -t monokai -T -N# 设置notebook界面和text/md cells的字体样式,并且设置字体大小# 字体大小的单位为ptjt -t oceans16 -tf merriserif -tfs 10 -nf ptsans -nfs 13# 设置cell的宽度与行高# 可以通过百分比来设置宽度jt -t chesterish -cellw 90% -lineh 170# 通过像素px来设置cell的宽度,设置为860pxjt -t solarizedd -cellw 860# 设置光标变成红色,并且将其大小变为5px# 可选的颜色 b (blue), o (orange), r (red), p (purple), g (green), x (font color)jt -t solarizedl -cursc r -cursw 5

jupyter-theme可用主题一览

默认主题

c8441171eb94afb19736d78e50c6b61f.png

chesterish

bbdb6d2c569b02b66e56cc91a51a4e9a.png

grade3

707a13ad10c296a1a765de4d55d60650.png

gruvboxd

3fcdd22ed2f88f0d491ee86098bd11f3.png

gruvboxl

751be5f5143f0f0ca15554963b330bb6.png

monokai

d224d354d43f88550cfb9f596b904eb8.png

oceans16

8eb4a7ea43934eea032d9552780d7e40.png

onedork

c6ca40cef1953752a165f878a4dc84f3.png

solarizedd

508720efdb9c5509f98922bb14df3d02.png

solarizedl

888095a6035fa0cbc21b5ef0e0ca1c48.png
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值