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

2016-07-11 11:38:08 +08:00
 imswing
听说 py3 不向下兼容?
5683 次点击
所在节点    Python
39 条回复
linpf
2016-07-11 12:01:12 +08:00
皮肉 3
yx30
2016-07-11 12:04:27 +08:00
3 吧
ChiangDi
2016-07-11 12:07:56 +08:00
你不会搜索一下嘛,这个问题在 V2 被问过好多次了
vertigo
2016-07-11 12:11:19 +08:00
py3 比较好,也渐渐克服之前库少的问题了
HLT
2016-07-11 12:13:32 +08:00
毫无疑问 P3
fy
2016-07-11 12:22:24 +08:00
楼主你问之前搜一下,每周都要有个两三次
Arrowing
2016-07-11 12:27:54 +08:00
我怎么感觉天天有人问这问题呢, 233333333
kkzxak47
2016-07-11 12:38:40 +08:00
没有历史遗留问题就选 3
MyFaith
2016-07-11 12:39:27 +08:00
我已经在去年从 Python2 转到 Python3 了,推荐你从 3 入手,因为早晚都要转到 3 , Python2 的编码问题是最头疼的。
hiluluke
2016-07-11 12:40:35 +08:00
3
tangzx
2016-07-11 12:43:15 +08:00
我军 60 秒后到达战场
flipped123
2016-07-11 12:45:45 +08:00
肯定用 3 啊,还用问?
misaka19000
2016-07-11 13:03:26 +08:00
v 站日经贴。。。

果断 3 啊,没什么好说的了
kulove
2016-07-11 13:28:33 +08:00
3
Pzdmultiverse
2016-07-11 14:45:21 +08:00
楼主,来坐个同学吧!
CRH
2016-07-11 15:25:31 +08:00
mikicomo
2016-07-11 15:28:25 +08:00
学生果断 3 ,马上要工作的..从 2 开始吧反正转 3 也很快
oh8
2016-07-11 16:25:14 +08:00
使用《 Python 学习手册》, 2 和 3 一起学, 2 和 3 一起学, 2 和 3 一起学, 2 和 3 一起学, 2 和 3 一起学!
qinxi
2016-07-11 17:16:18 +08:00
先买个尺子吧.
LuvLetter
2016-07-11 17:35:37 +08:00
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.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/291662

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX