One - One Code All

Blog Content

python格式化工具yapf

Python   2015-12-27 13:53:26

tensorflow中使用的格式化工具,支持autopep8, pep8ify 

官网:https://github.com/google/yapf


安装:

pip3 install yapf


参数:

-p:使用多线程

--style:chromium保持80列换行,indent_width,前面4个空格

-i:直接在原文件修改,inplace操作

-r:递归的所有文件都进行该操作

./:当前目录,也可以为具体文件,./test.py


例子:

yapf -p --style='{based_on_style: chromium, indent_width: 4}' -i -r ./



上一篇:Sqlalchemy中mysql分组groupby用法 incompatible only_full_group_by解决方法
下一篇:文件下载命令wget,curl,axel

The minute you think of giving up, think of the reason why you held on so long.