[Turn] Jupyter Notebook theme font settings and automatic code completion Jupyter Notebook theme font settings and automatic code completion

Jupyter Notebook theme font settings and automatic code completion

 

Jupyter Notebook with a long time can not be separated, however it comes with the theme really could not bear to look. For the sake of vision, for their own looks comfortable, so toss a lot. . Github found on a jupyter-themes tool, it can be mounted by pip, very easy to use.

The first is to download the theme, the command line is as follows:

pip install --no-dependencies jupyterthemes==0.18.2

Installed, the computer may prompt some lack  lesscpy , continue the installation pip

pip install lesscpy

Then choose the subject, set the font size, I summed up one of my favorite

jt --lineh 140 -f consolamono -tf ptmono -t grade3 -ofs 14 -nfs 14 -tfs 14 -fs 14 -T -N

 Command line format explained in the following table

cl options arg default
Usage help -h --
List Themes -l --
Theme Name to Install -t --
Font Code -f --
Code Font-Size -fs 11
Notebook Font -nf --
Notebook Font Size -nfs 13
Text/MD Cell Font -tf --
Text/MD Cell Fontsize -tfs 13
Pandas DF Fontsize dfs 9
Output Area Fontsize -ofs 8.5
Mathjax Fontsize (%) -mathfs 100
Intro Page Margins -m auto
Cell Width -cellw 980
Line Height -Lineh 170
Cursor Width -cursw 2
cursor Color -cursc --
Alt Prompt Layout -altp --
Alt Markdown BG Color -altmd --
Alt Output BG Color -altout --
Style Vim NBExt* -vim --
Toolbar Visible -T --
Name & Logo Visible -N --
Reset Default Theme -r --
Force Default Fonts -dfonts --

 

Attach the final result

 

 Then let jupyter notebook automatic code completion, first install  nbextensions

pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user

Then install  nbextensions_configurator

pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user

If the missing dependency prompted, dependent on the use of the corresponding installation can pip.

Finally restart jupyter, pop-up in the main page, you can see the addition of a Nbextensions tab, in this page, check the Hinterland that is enabled for automatic code completion, as shown:

 

Then open a note, to feel it.

Author:  marsh Come

Source: https://www.cnblogs.com/qiuxirufeng/p/9609031.html

This site uses " CC BY 4.0 " Creative Commons agreement, reproduced in the article clearly indicate the position of the author and source.

Jupyter Notebook用久了就离不开了,然而自带的主题真的不忍直视。为了视力着想,为了自己看起来舒服,于是折腾了一番。。在github上发现了一个jupyter-themes工具,可以通过pip安装,非常方便使用。

首先是主题下载,命令行如下所示:

pip install --no-dependencies jupyterthemes==0.18.2

安装好了,有的电脑可能会提示缺少 lesscpy,继续 pip 安装

pip install lesscpy

然后是对主题选择、字体大小进行设置,我总结了一个我最喜欢的

jt --lineh 140 -f consolamono -tf ptmono -t grade3 -ofs 14 -nfs 14 -tfs 14 -fs 14 -T -N

 命令行的格式的解释如下表所示

cl options arg default
Usage help -h --
List Themes -l --
Theme Name to Install -t --
Code Font -f --
Code Font-Size -fs 11
Notebook Font -nf --
Notebook Font Size -nfs 13
Text/MD Cell Font -tf --
Text/MD Cell Fontsize -tfs 13
Pandas DF Fontsize dfs 9
Output Area Fontsize -ofs 8.5
Mathjax Fontsize (%) -mathfs 100
Intro Page Margins -m auto
Cell Width -cellw 980
Line Height -lineh 170
Cursor Width -cursw 2
Cursor Color -cursc --
Alt Prompt Layout -altp --
Alt Markdown BG Color -altmd --
Alt Output BG Color -altout --
Style Vim NBExt* -vim --
Toolbar Visible -T --
Name & Logo Visible -N --
Reset Default Theme -r --
Force Default Fonts -dfonts --

 

附上最终效果

 

 接着让 jupyter notebook 实现自动代码补全,首先安装 nbextensions

pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user

然后安装 nbextensions_configurator

pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user

如果提示缺少依赖,就使用pip安装对应依赖即可。

最后重启jupyter,在弹出的主页面里,能看到增加了一个Nbextensions标签页,在这个页面里,勾选Hinterland即启用了代码自动补全,如图所示:

 

这时打开一个笔记,来感受一下吧。

Guess you like

Origin www.cnblogs.com/chanshion/p/12389200.html