python解释器的安装

Python(解释器)的发展史

# 1989年,Guido开始写Python语言的编译器。
# 1991年,第一个Python编译器诞生。它是用C语言实现的,并能够调用C语言的库文件。从一出生,Python已经具有了:类,函数,异常处理,包含表和词典在内的核心数据类型,以及模块为基础的拓展系统。
# Granddaddy of Python web frameworks, Zope 1 was released in 1999
# Python 1.0 - January 1994 增加了 lambda, map, filter and reduce.
# Python 2.0 - October 16, 2000,加入了内存回收机制,构成了现在Python语言框架的基础
# Python 2.4 - November 30, 2004, 同年目前最流行的WEB框架Django 诞生
# Python 2.5 - September 19, 2006
# Python 2.6 - October 1, 2008
# Python 2.7 - July 3, 2010
# 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
# Python 3.0 - December 3, 2008 (这里要解释清楚 为什么08年就出3.0,2010年反而又推出了2.7?是因为3.0不向下兼容2.0,导致大家都拒绝升级3.0,无奈官方只能推出2.7过渡版本)
# Python 3.1 - June 27, 2009
# Python 3.2 - February 20, 2011
# Python 3.3 - September 29, 2012
# Python 3.4 - March 16, 2014
# Python 3.5 - September 13, 2015
# Python 3.6 - 2016-12-23 发布python3.6.0版

    Pyhton的发展前景怎么样?

#知乎上有一篇文章,问Python未来10年的发展前景,Alex强烈要求我告诉你们去看看他的回答
#未来十年Python的前景会怎样? https://www.zhihu.com/question/22112542/answer/166053516

    Python 有哪些种类?

我们现在知道了Python是一门解释型语言,代码想运行,必须通过解释器执行,Python的解释器本身也可以看作是个程序(翻译官司是哪国人不重要),这个程序是什么语言开发的呢? 答案是好几种语言? what? 因为Python有好几种解释器,分别基于不同语言开发,每个解释器特点不同,但都能正常运行我们的Python代码,下面分别来看下:

#CPython:CPython是使用最广且被的Python解释器。本教程以CPython为准。
当我们从Python官方网站下载并安装好Python 2.7后,我们就直接获得了一个官方版本的解释器:CPython。这个解释器是用C语言开发的,所以叫CPython。在命令行下运行python就是启动CPython解释器。

#IPython
IPython是基于CPython之上的一个交互式解释器,也就是说,IPython只是在交互方式上有所增强,但是执行Python代码的功能和CPython是完全一样的。好比很多国产浏览器虽然外观不同,但内核其实都是调用了IE。
CPython用>>>作为提示符,而IPython用In [序号]:作为提示符。

#PyPy
PyPy是另一个Python解释器,它的目标是执行速度。PyPy采用JIT技术,对Python代码进行动态编译(注意不是解释),所以可以显著提高Python代码的执行速度。
绝大部分Python代码都可以在PyPy下运行,但是PyPy和CPython有一些是不同的,这就导致相同的Python代码在两种解释器下执行可能会有不同的结果。如果你的代码要放到PyPy下执行,就需要了解PyPy和CPython的不同点。

#Jython
Jython是运行在Java平台上的Python解释器,可以直接把Python代码编译成Java字节码执行。

#IronPython
IronPython和Jython类似,只不过IronPython是运行在微软.Net平台上的Python解释器,可以直接把Python代码编译成.Net的字节码。

    Python 2 or Python 3 ?

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 for backwards compatibility 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 for newcomers 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).
目前虽然业内很多企业还在大量使用Python2.6 or 2.7,因为旧项目几十万甚至上百万行的代码想快速升级到3.0不是件容易的事,但是大家在开发新项目时几乎都会使用3.x。
另外Python3 确实想比2.x做了很多的改进,直观点来讲,就像从XP升级到Win7的感觉一样,棒棒的。
Py2 和Py3的具体细节区别我们在以后课程中会慢慢深入。

安装python解释器

    Python目前已支持所有主流操作系统,在Linux,Unix,Mac系统上自带Python环境,在Windows系统上需要安装一下,超简单

    打开官网 https://www.python.org/downloads/windows/ 下载中心

#测试安装是否成功
windows --> 运行 --> 输入cmd ,然后回车,弹出cmd程序,输入python,如果能进入交互环境 ,代表安装成功。

 

#多版本共存演示
注意:在安装目录下找到python.exe,拷贝一份,命名为python2.exe或python3.exe,一定要保留原版,因为pip工具会调用它。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值