aheadlead
V2EX  ›  问与答

请推荐一个 Python 的编码规范

  •  
  •   aheadlead · Sep 19, 2014 · 6186 views
    This topic created in 4427 days ago, the information mentioned may be changed or developed.
    我很喜欢林锐博士的《高质量C/C++编程指南》,不知道Python有没有类似的文档。请大家推荐一份。

    谢谢!
    15 replies  •  2014-09-20 12:41:37 +08:00
    leiz
    leiz
    Sep 19, 2014❤️1
    3
    pep8
    ehs2013
    ehs2013
    Sep 19, 2014❤️1
    4
    PEP-8
    d0o0g
    d0o0g
    Sep 19, 2014❤️1
    5
    pep8 +1
    janxin
    janxin
    Sep 19, 2014❤️1
    6
    PEP 8 -- Style Guide for Python Code
    http://legacy.python.org/dev/peps/pep-0008/
    likexian
    likexian
    Sep 19, 2014
    7
    pep8
    用flake8自检
    reorx
    reorx
    Sep 19, 2014
    8
    为了在组内推行 Python 编码规范,我曾经总结过一个,lz 可以参考下: https://gist.github.com/reorx/9a66db7bf7b90f351b43
    reorx
    reorx
    Sep 19, 2014
    9
    @Livid 如果可以选择让 gist 不展开就好了呢,或者可以限制其展开的长度,如果太长则只展示部分内容。
    precisi0nux
    precisi0nux
    Sep 19, 2014
    10
    @reorx
    @Livid 8楼排版有问题,文字和头像的距离明显太近了,回复图标和楼层号也在灰色区域了。
    iptux
    iptux
    Sep 19, 2014
    11
    用 TAB 做为缩进的一个好处是相对与用空格做缩进来说文件更小
    这是个人偏好于 TAB 缩进的一大原因
    banbanchs
    banbanchs
    Sep 19, 2014
    12
    用pycharm就能让你养成良好习惯
    virusdefender
    virusdefender
    Sep 20, 2014
    13
    同意楼上 pycharm自带pep8检查功能
    g0t3n
    g0t3n
    Sep 20, 2014
    14
    @virusdefender
    @banbanchs
    pycharm 有木有 vim 输入的风格捏~ 感觉没有了 hjkl 等输入习惯用起来很不顺手。。
    banbanchs
    banbanchs
    Sep 20, 2014
    15
    @g0t3n ideavim
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5068 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 73ms · UTC 07:54 · PVG 15:54 · LAX 23:54 · JFK 02:54
    ♥ Do have faith in what you're doing.