推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
imswing
V2EX  ›  Python

从零学习 Python 的话,应该学习 py3 还是 py2?

  •  
  •   imswing · Jul 11, 2016 · 7082 views
    This topic created in 3775 days ago, the information mentioned may be changed or developed.
    听说 py3 不向下兼容?
    39 replies  •  2016-07-13 09:38:31 +08:00
    linpf
    linpf
    Jul 11, 2016
    1
    皮肉 3
    yx30
    yx30
    Jul 11, 2016
    2
    3 吧
    ChiangDi
    ChiangDi
    Jul 11, 2016 via Android
    3
    你不会搜索一下嘛,这个问题在 V2 被问过好多次了
    vertigo
    vertigo
    Jul 11, 2016
    4
    py3 比较好,也渐渐克服之前库少的问题了
    HLT
    HLT
    Jul 11, 2016
    5
    毫无疑问 P3
    fy
    fy
    Jul 11, 2016
    6
    楼主你问之前搜一下,每周都要有个两三次
    Arrowing
    Arrowing
    Jul 11, 2016
    7
    我怎么感觉天天有人问这问题呢, 233333333
    kkzxak47
    kkzxak47
    Jul 11, 2016 via Android
    8
    没有历史遗留问题就选 3
    MyFaith
    MyFaith
    Jul 11, 2016
    9
    我已经在去年从 Python2 转到 Python3 了,推荐你从 3 入手,因为早晚都要转到 3 , Python2 的编码问题是最头疼的。
    hiluluke
    hiluluke
    Jul 11, 2016
    10
    3
    tangzx
    tangzx
    Jul 11, 2016 via iPhone
    11
    我军 60 秒后到达战场
    flipped123
    flipped123
    Jul 11, 2016
    12
    肯定用 3 啊,还用问?
    misaka19000
    misaka19000
    Jul 11, 2016
    13
    v 站日经贴。。。

    果断 3 啊,没什么好说的了
    kulove
    kulove
    Jul 11, 2016
    14
    3
    Pzdmultiverse
    Pzdmultiverse
    Jul 11, 2016
    15
    楼主,来坐个同学吧!
    CRH
    CRH
    Jul 11, 2016
    16
    mikicomo
    mikicomo
    Jul 11, 2016
    17
    学生果断 3 ,马上要工作的..从 2 开始吧反正转 3 也很快
    oh8
    oh8
    Jul 11, 2016
    18
    使用《 Python 学习手册》, 2 和 3 一起学, 2 和 3 一起学, 2 和 3 一起学, 2 和 3 一起学, 2 和 3 一起学!
    qinxi
    qinxi
    Jul 11, 2016
    19
    先买个尺子吧.
    LuvLetter
    LuvLetter
    Jul 11, 2016
    20
    Which Python Should I Use?
    Version choice may be mandated by your organization, but if you ’ re new to Python and learning on your own, you may be wondering which version to install. The answer here depends on your goals. Here are a few suggestions on the choice.
    When to choose 3.X: new features, evolution
    If you are learning Python for the first time and don ’ t need to use any existing 2.X code, I encourage you to begin with Python 3.X. It cleans up some longstanding warts in the language and trims some dated cruft, while retaining all the original core ideas and adding some nice new tools. For example, 3.X ’ s seamless Unicode model and broader use of generators and functional techniques are seen by many users as assets. Many popular Python libraries and tools are already available for Python 3.X, or will be by the time you read these words, especially given the con- tinual improvements in the 3.X line. All new language evolution occurs in 3.X only, which adds features and keeps Python relevant, but also makes language definition a constantly moving target — a tradeoff inherent on the leading edge.
    When to choose 2.X: existing code, stability
    If you ’ ll be using a system based on Python 2.X, the 3.X line may not be an option for you today. However, you ’ ll find that this book addresses your concerns, too, and will help if you migrate to 3.X in the future. You ’ ll also find that you ’ re in large company. Every group I taught in 2012 was using 2.X only, and I still regularly see useful Python software in 2.X-only form. Moreover, unlike 3.X, 2.X is no longer being changed — which is either an asset or liability, depending on whom you ask. There ’ s nothing wrong with using and writing 2.X code, but you may wish to keep tabs on 3.X and its ongoing evolution as you do. Python ’ s future remains to be written, and is largely up to its users, including you.
    When to choose both: version-neutral code
    Probably the best news here is that Python ’ s fundamentals are the same in both its lines — 2.X and 3.X differ in ways that many users will find minor, and this book is designed to help you learn both. In fact, as long as you understand their differ- ences, it ’ s often straightforward to write version-neutral code that runs on both Pythons, as we regularly will in this book. See Appendix C for pointers on 2.X/3.X migration and tips on writing code for both Python lines and audiences.
    ayaseangle
    ayaseangle
    Jul 11, 2016
    21
    为什么 v 站都是这种问题,感觉质量大不如以前了。。
    wizardforcel
    wizardforcel
    Jul 11, 2016
    22
    v 站的信息熵持续走高啊。。。
    sunwei0325
    sunwei0325
    Jul 11, 2016
    23
    scrapy, supervisor, fabric 都能用 py3?
    herozhang
    herozhang
    Jul 11, 2016
    24
    3
    wojiaodaxiaxia
    wojiaodaxiaxia
    Jul 11, 2016
    25
    屁眼 3
    Licamla
    Licamla
    Jul 11, 2016
    26
    去年也在纠结这个,然后一边学 python3 一边断断续续地翻译《 Supporting Python 3 (支持 Python 3 )》,
    地址: http://my.oschina.net/soarwilldo/blog/508410#OSC_h1_1

    最后工作中用 python2.7 写 python3 风格代码,然而没有用到多少书中的那么多的内容。
    neoblackcap
    neoblackcap
    Jul 12, 2016
    27
    3, 接下来的 3 的效率会越来越高,而且还有各种更好的特性,更好的标准库
    likuku
    likuku
    Jul 12, 2016
    28
    py2.7 向上 /py3 兼容
    peter999
    peter999
    Jul 12, 2016
    29
    当然是 2 ,好多库都不支持 3 ,当然按照许多人的说法你可以自己改造这些库让他们支持 3 ,如果你可以说服老板的话
    latyas
    latyas
    Jul 12, 2016
    30
    @peter999 举几个必须要用 2 的库的例子?
    vexjoe
    vexjoe
    Jul 12, 2016 via iPhone
    31
    其实这个日经一点也没关系,这样新手们就有更大的几率看到 Py3 的推荐,从而进入 Py3 的社区,这样 Py3 的生态就会渐渐繁荣,不至于造成无人问津,然后僵死于 Py2 的情况。
    jugelizi
    jugelizi
    Jul 12, 2016
    32
    @latyas pdfminer 不支持 3
    autulin
    autulin
    Jul 12, 2016 via Android
    33
    看需求吧
    比如我做作业要爬虫,于是想到用 scrapy ,可是官方推荐在 py2 上用
    如果只是想语法入门,那还用在乎 3 还是 2 吗?
    yufpga
    yufpga
    Jul 12, 2016
    34
    都学了不就得了,学会其中一种,再看另外一种时间成本又不高.
    latyas
    latyas
    Jul 12, 2016 via iPhone
    35
    @jugelizi pypi 上搜了一下不是有 3 的移植版么?
    smallsix
    smallsix
    Jul 12, 2016
    36
    python3
    SlipStupig
    SlipStupig
    Jul 12, 2016
    37
    @autulin python2 和 3 已经语法发送了较大的变化了
    fire5
    fire5
    Jul 12, 2016
    38
    直接学习 go 嘿嘿
    autulin
    autulin
    Jul 13, 2016 via Android
    39
    @SlipStupig 我没说清楚,我想说的是思想学到了,语法只是形式上的问题而已
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   913 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 91ms · UTC 20:30 · PVG 04:30 · LAX 12:30 · JFK 15:30
    ♥ Do have faith in what you're doing.