求点赞
Black是一款强大的标准化编程软件,可以迅速让你的代码变得更规范工整。
在Jupyternotebook中,要使用Black,首先
pip install blackcellmagic
然后在jupyter notebook的cell中,运行
%load_ext blackcellmagic
然后在需要对代码进行规范的cell中使用魔术命令:
%%black
-----update
更简便的方法!!!!
pip install nb-black
In the first cell of Jupyter notebook file, input:
%load_ext nb_black
DONE