aheadlead
V2EX  ›  问与答

请推荐一个 Python 的编码规范

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

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