Python是一门简单易学且功能强大的编程语言。它拥有高效的高级数据结构,并且能够用简单而又高效的方式进行面向对象编程。Python优雅的语法和动态类型,再结合它的解释性,使其在大多数平台的许多领域成为编写脚本或开发应用程序的理想语言。

Python解释器和广泛的标准库可以从源代码或二进制形式免费提供给来自Python网站https://www.Python.org/的所有主要平台,并可以免费分发。同时网站还包含许多免费的第三方Python模块,程序和工具以及其他文档的发布和指针。

Python解释器很容易扩展,使用C或C++实现的新功能和数据类型(或可从C调用的其他语言)。Python也适合作为可定制应用程序的扩展语言。

Python的设计具有很强的可读性,相比其他语言经常使用英文关键字,其他语言的一些标点符号,它具有比其他语言更有特色语法结构。

Python是一种解释型语言:这意味着开发过程中没有了编译这个环节。类似于PHP和Perl语言;

Python是交互式语言:这意味着,您可以在一个Python提示符,直接互动执行写你的程序;

Python是面向对象语言:这意味着Python支持面向对象的风格或代码封装在对象的编程技术;

Python是初学者的语言:Python对初级程序员而言,是一种伟大的语言,它支持广泛的应用程序开发,从简单的文字处理到复杂的浏览器甚至游戏开发等。

Python发展历史

Python的作者是荷兰人Guido von Rossum,1982年,Guido从阿姆斯特丹大学(University of Amsterdam)获得了数学和计算机硕士学位。尽管拥有数学和计算机双料资质,他总趋向于做计算机相关的工作,并热衷于做任何和编程相关的活儿。

1989年,为了打发圣诞节假期,Guido开始写Python语言的编译/解释器。Python来自Guido所挚爱的电视剧Monty Python's Flying Circus (BBC1960-1970年代播放的室内情景幽默剧,以当时的英国生活为素材)。他希望这个新的叫做Python的语言,能实现他的理念(一种C和shell之间,功能全面,易学易用,可拓展的语言)。Guido作为一个语言设计爱好者,已经有过设计语言的(不很成功)的尝试。这一次,也不过是一次纯粹的hacking行为。

1991年,第一个Python编译器(同时也是解释器)诞生。它是用C语言实现的,并能够调用C库(.so文件)。从一出生,Python已经具有了:类(class),函数(function),异常处理(exception),包括表(list)和词典(dictionary)在内的核心数据类型,以及模块(module)为基础的拓展系统。

今天Python已经进入到3.0的时代。由于Python 3.0向后不兼容,所以从2.0到3.0的过渡并不容易。另一方面,Python的性能依然值得改进,Python的运算性能低于C++和Java(见Google的讨论)。因此Python依然是一个在发展中的语言。

Python特点

1. 易于学习:Python有相对较少的关键字,结构简单,和一个明确定义的语法,学习起来更加简单;

2. 易于阅读:Python代码定义的更清晰;

3. 易于维护:Python的成功在于它的源代码是相当容易维护的;

4. 一个广泛的标准库:Python的最大的优势之一是丰富的库,跨平台的,在UNIX,Windows和Macintosh兼容很好;

5. 互动模式:互动模式的支持,您可以从终端输入执行代码并获得结果的语言,互动的测试和调试代码片断;

6. 可移植:基于其开放源代码的特性,Python已经被移植(也就是使其工作)到许多平台;

7. 可扩展:如果你需要一段运行很快的关键代码,或者是想要编写一些不愿开放的算法,你可以使用C或C++完成那部分程序,然后从你的Python程序中调用;

8. 数据库:Python提供所有主要的商业数据库的接口;

9. GUI编程:Python支持GUI可以创建和移植到许多系统调用;

10. 可嵌入: 你可以将Python嵌入到C/C++程序,让你的程序的用户获得"脚本化"的能力。

Python2和Python3所有版本

Release versionRelease date Click for more
Python 3.6.32017-10-03DownloadRelease Notes
Python 3.3.72017-09-19DownloadRelease Notes
Python 2.7.142017-09-16DownloadRelease Notes
Python 3.4.72017-08-09DownloadRelease Notes
Python 3.5.42017-08-08DownloadRelease Notes
Python 3.6.22017-07-17DownloadRelease Notes
Python 3.6.12017-03-21DownloadRelease Notes
Python 3.4.62017-01-17DownloadRelease Notes
Python 3.5.32017-01-17DownloadRelease Notes
Python 3.6.02016-12-23DownloadRelease Notes
Python 2.7.132016-12-17DownloadRelease Notes
Python 3.4.52016-06-27DownloadRelease Notes
Python 3.5.22016-06-27DownloadRelease Notes
Python 2.7.122016-06-25DownloadRelease Notes
Python 3.4.42015-12-21DownloadRelease Notes
Python 3.5.12015-12-07DownloadRelease Notes
Python 2.7.112015-12-05DownloadRelease Notes
Python 3.5.02015-09-13DownloadRelease Notes
Python 2.7.102015-05-23DownloadRelease Notes
Python 3.4.32015-02-25DownloadRelease Notes
Python 2.7.92014-12-10DownloadRelease Notes
Python 3.4.22014-10-13DownloadRelease Notes
Python 3.3.62014-10-12DownloadRelease Notes
Python 3.2.62014-10-12DownloadRelease Notes
Python 2.7.82014-07-02DownloadRelease Notes
Python 2.7.72014-06-01DownloadRelease Notes
Python 3.4.12014-05-19DownloadRelease Notes
Python 3.4.02014-03-17DownloadRelease Notes
Python 3.3.52014-03-09DownloadRelease Notes
Python 3.3.42014-02-09DownloadRelease Notes
Python 3.3.32013-11-17DownloadRelease Notes
Python 2.7.62013-11-10DownloadRelease Notes
Python 2.6.92013-10-29DownloadRelease Notes
Python 3.2.52013-05-15DownloadRelease Notes
Python 3.3.22013-05-15DownloadRelease Notes
Python 2.7.52013-05-12DownloadRelease Notes
Python 3.3.12013-04-06DownloadRelease Notes
Python 3.2.42013-04-06DownloadRelease Notes
Python 2.7.42013-04-06DownloadRelease Notes
Python 3.3.02012-09-29DownloadRelease Notes
Python 3.2.32012-04-10DownloadRelease Notes
Python 2.6.82012-04-10DownloadRelease Notes
Python 2.7.32012-04-09DownloadRelease Notes
Python 3.1.52012-04-09DownloadRelease Notes
Python 3.2.22011-09-03DownloadRelease Notes
Python 3.2.12011-07-09DownloadRelease Notes
Python 3.1.42011-06-11DownloadRelease Notes
Python 2.7.22011-06-11DownloadRelease Notes
Python 2.6.72011-06-03DownloadRelease Notes
Python 2.5.62011-05-26DownloadRelease Notes
Python 3.2.02011-02-20DownloadRelease Notes
Python 2.7.12010-11-27DownloadRelease Notes
Python 3.1.32010-11-27DownloadRelease Notes
Python 2.6.62010-08-24DownloadRelease Notes
Python 2.7.02010-07-03DownloadRelease Notes
Python 3.1.22010-03-20DownloadRelease Notes
Python 2.6.52010-03-18DownloadRelease Notes
Python 2.5.52010-01-31DownloadRelease Notes
Python 2.6.42009-10-26DownloadRelease Notes
Python 2.6.32009-10-02DownloadRelease Notes
Python 3.1.12009-08-17DownloadRelease Notes
Python 3.1.02009-06-26DownloadRelease Notes
Python 2.6.22009-04-14DownloadRelease Notes
Python 3.0.12009-02-13DownloadRelease Notes
Python 2.5.42008-12-23DownloadRelease Notes
Python 2.4.62008-12-19DownloadRelease Notes
Python 2.5.32008-12-19DownloadRelease Notes
Python 2.6.12008-12-04DownloadRelease Notes
Python 3.0.02008-12-03DownloadRelease Notes
Python 2.6.02008-10-02DownloadRelease Notes
Python 2.3.72008-03-11DownloadRelease Notes
Python 2.4.52008-03-11DownloadRelease Notes
Python 2.5.22008-02-21DownloadRelease Notes
Python 2.5.12007-04-19DownloadRelease Notes
Python 2.3.62006-11-01DownloadRelease Notes
Python 2.4.42006-10-18DownloadRelease Notes
Python 2.5.02006-09-19DownloadRelease Notes
Python 2.4.32006-04-15DownloadRelease Notes
Python 2.4.22005-09-27DownloadRelease Notes
Python 2.4.12005-03-30DownloadRelease Notes
Python 2.3.52005-02-08DownloadRelease Notes
Python 2.4.02004-11-30DownloadRelease Notes
Python 2.3.42004-05-27DownloadRelease Notes
Python 2.3.32003-12-19DownloadRelease Notes
Python 2.3.22003-10-03DownloadRelease Notes
Python 2.3.12003-09-23DownloadRelease Notes
Python 2.3.02003-07-29DownloadRelease Notes
Python 2.2.32003-05-30DownloadRelease Notes
Python 2.2.22002-10-14DownloadRelease Notes
Python 2.2.12002-04-10DownloadRelease Notes
Python 2.1.32002-04-09DownloadRelease Notes
Python 2.2.02001-12-21DownloadRelease Notes
Python 2.0.12001-06-22DownloadRelease Notes

相对于Python2.0,Python的3.0版本,常被称为Python 3000,或简称Py3k。相对于Python的早期版本,这是一个较大的升级。为了不带入过多的累赘,Python 3.0在设计的时候没有考虑向下兼容。许多针对早期Python版本设计的程序都无法在Python 3.0上正常运行。为了照顾现有程序,Python 2.6作为一个过渡版本,基本使用了Python 2.x的语法和库,同时考虑了向Python 3.0的迁移,允许使用部分Python 3.0的语法与函数。基于早期Python版本而能正常运行于Python 2.6并无警告。程序可以通过一个2to3的转换工具无缝迁移到Python 3.0。Python有一些很有用的测试模块,包括doctext和unitest。确保在尝试移植到Python3之前,对应用程序进行全面测试。要确保测试范围尽可能大,而且程序在Python2.6上运行时,能通过测试并且没有出现任何警告信息。

新的Python程序建议使用Python 3.0版本的语法。除非运行环境无法安装Python 3.0或者程序本身使用了不支持Python 3.0的第三方库。目前不支持Python 3.0的第三方库有Twisted, py2exe, PIL等。大多数第三方库都正在努力地兼容Python 3.0版本。即使无法立即使用Python 3.0,也建议编写兼容Python 3.0版本的程序,然后使用Python 2.6, Python 2.7来运行。Python 2.7被确定为最后一个Python 2.x版本,它除了支持Python 2.x语法外,还支持部分Python 3.1语法。

关注下方微信公众号“Java精选”(w_z90110),回复关键词领取资料:如Mysql、Hadoop、Dubbo、Spring Boot等,免费领取视频教程、资料文档和项目源码。

Java精选专注程序员推送一些Java开发知识,包括基础知识、各大流行框架(Mybatis、Spring、Spring Boot等)、大数据技术(Storm、Hadoop、MapReduce、Spark等)、数据库(Mysql、Oracle、NoSQL等)、算法与数据结构、面试专题、面试技巧经验、职业规划以及优质开源项目等。其中一部分由小编总结整理,另一部分来源于网络上优质资源,希望对大家的学习和工作有所帮助。

评论

  1. #1

    无极天尊 (2017/10/26 10:39:35)回复
    正在研究 python3 ,一起嗨 !

  2. #2

    (2017/10/26 10:30:43)回复
    讲的很详细,给人一种马上想学的冲动,我学习完目前我所学的,会考虑学习看看。

    路人甲 (2017/10/26 11:04:25)回复
    感谢留言支持,谢谢大家我会更努力的写python教程!

  3. #3

    SIX (2017/10/26 10:23:51)回复
    66666666写的很好,感谢博主无私的总结分享。

  4. #4

    假诗人 (2017/10/23 16:37:00)回复
    写的很好等我学Python的时候就选择学习3.0吧,感谢博主无私的总结分享。

分享:

支付宝

微信