
发展历程
History
关于python的初学者来说,会发现其实很多人都是用得python2.7,可是现在python现已更新到了3点几的版本。是学习最新的3好呢,仍是应用比较广的2.7好呢?看看我们怎么说
In November 2014, it was announced that Python 2.7 would be supported until 2020, and reaffirmed that there would be no 2.8 release as users were expected to move to Python 3.4+ as soon as possible
百度翻译:本年2014年11月宣布,Python 2.7将在2020之前得到支撑,并重申不会有2.8版本的发布,因为用户期望尽快移动到Python 3.4以上。
In summary : Python 2.x is legacy, Python 3.x is the present and future of the language
Python 3.0 was released in 2008. The final 2.x version 2.7 release came out in mid-2010, with a statement of
extended support for this end-of-life release. The 2.x branch will see no new major releases after that. 3.x is
under active development and has already seen over five years of stable releases, including version 3.3 in 2012,
3.4 in 2014, and 3.5 in 2015. This means that all recent standard library improvements, for example, are only
available by default in Python 3.x.
Guido van Rossum (the original creator of the Python language) decided to clean up Python 2.x properly, with less regard patibility than is the case for new releases in the 2.x range. The most drastic improvement is the better Unicode support (with all text strings being Unicode by default) as well as saner bytes/Unicode separation.
Besides, several aspects of the core language (such as print and exec being statements, integers using floor division) have been adjusted to be easier ers to learn and to be more consistent with the rest of the language, and old cruft has been removed (for example, all classes are now new-style, "range()" returns a memory efficient iterable, not a list as in 2.x).
百度翻译:
总之:Python 2是遗留的,Python 3是言语的现在和未来。
Python 3在2008发布。终究的2×2.7版本发布了2010年年中,与声明
延长对这一报废版本的支撑。在这之后,2 x分支不会看到新的主要版本。3 x是
在积极的开展中,现已看到了五年的安稳版本,包括2012版3.3版,
3.4在2014,2015在3.5。这意味着,所有最近的规范库的改善,例如,只
默认使用Python 3。
Guido van Rossum(Python言语的发明者)抉择整理Python 2。x是正确的,不考虑向后兼容性比在2新版本的状况下,X系列。最激烈的改善是更好的支撑Unicode(所有文本字符串是Unicode默认)以及沉着的字节/ Unicode别离。
此外,在言语的核心的几个方面(如打印和exec被陈述,整数使用地板处)已被调整到适合新人学习容易,要与其他的言语更加一致,老的那些东西已被删除(例如,所有的类都是现在新型的、“range()”返回一个高效的迭代,不列为2 x)。
培训教师的建议 假如是你在企业中,需要用到python而学习python的话,那就要看企业的应用python的版本进行学习; 假如想要更多的成熟解决方案,最少的bug,最安稳的应用那就用python2 ; 假如你是在读大学的学生,那我建议你学习python3,等到毕业的时分或许python现已成为了干流。 使用者观念python 3 有很大改善,比 2 更容易了解。
假如题主抉择学 2,建议当被 string bytes 搞晕时,了解一下 3,再做抉择。
另外,3 的库现已比较全了,不支撑 3 的,大都是不再维护的。
从开源项目可以看出,新项目基于或支撑Python3 的比例现已大大提高。
知名的开源项目一般都是支撑python2.7 和 python3+, 也有破例,比如Scrapy 只支撑Python2.7。
假如是新项目,并且对已有项目没有依赖,建议选择Python3.3+。
不然选择Python2.7 (2.7 曾经的根本被废弃了)
没有前史包袱就决断用3。 之前写了一大堆2的代码了没方法那只能用2了。 现在大大都常用库都支撑3了。
来历:本文由原创撰写,欢迎分享本文,转载请保留出处和链接!2016年 —— 何群书记来我院指导党风廉政建设工作
2017年 —— 善行天下 温暖患儿”慈善募捐月活动,团队有多年丰富的建站经验
扫描二维码分享到微信