python 语法规范(python基础教程)

网友投稿 277 2022-09-02


python 语法规范(python基础教程)

在python shell 中输入 import this

可以看到python之禅

The Zen of Python, by Tim PetersBeautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is better than nested.Sparse is better than dense.Readability counts.Special cases aren't special enough to break the rules.Although practicality beats purity.Errors should never pass silently.Unless explicitly silenced.In the face of ambiguity, refuse the temptation to guess.There should be one-- and preferably only one --obvious way to do it.Although that way may not be obvious at first unless you're Dutch.Now is better than never.Although never is often better than *right* now.If the implementation is hard to explain, it's a bad idea.If the implementation is easy to explain, it may be a good idea.Namespaces are one honking great idea -- let's do more of those!

官网中的PEP8标准

详细的预防规范

官网路径:Documentation——Developer’s Guide——PEP 8

​​PEP 8 -- Style Guide for Python Code​​

pycharm配置autopep8

配置后,自动格式化代码

安装 autopep8

cmd窗口输入:pip install autopep8

在Pycharm中安装autopep8配置

配置项目


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:java springboot邮箱找回密码功能的实现讲解
下一篇:python装饰器(python装饰器的原理)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~