2 Python 介绍
1 Python創(chuàng)始人-吉多·范羅蘇姆(Guido van Rossum)(龜叔)
1989年的圣誕節(jié)期間,Guido開始寫Python語言的編譯器。Python這個(gè)名字,來自Guido所摯愛的電視劇Monty Python’s Flying Circus。
他希望這個(gè)新的叫做Python的語言,能符合他的理想:創(chuàng)造一種C和shell之間,功能全面,易學(xué)易用,可拓展的語言。
2 Python 的發(fā)展史
1989年,Guido開始寫Python語言的編譯器。
1991年,第一個(gè)Python編譯器誕生。它是用C語言實(shí)現(xiàn)的,并能夠調(diào)用C語言的庫文件。從一出生,Python已經(jīng)具有了:類,函數(shù),異常處理,包含表和詞典在內(nèi)的核心數(shù)據(jù)類型,以及模塊為基礎(chǔ)的拓展系統(tǒng)。
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,加入了內(nèi)存回收機(jī)制,構(gòu)成了現(xiàn)在Python語言框架的基礎(chǔ)
Python 2.4 - November 30, 2004, 同年目前最流行的WEB框架Django 誕生
Python 2.5 - September 19, 2006
Python 2.6 - October 1, 2008
Python 3.0 - December 3, 2008 (這里要解釋清楚 為什么08年就出3.0,2010年反而又推出了2.7?是因?yàn)?.0不向下兼容2.0,導(dǎo)致大家都拒絕升級3.0,無奈官方只能推出2.7過渡版本)
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.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 發(fā)布python3.6.0版
3 Python 的種類
CPython
當(dāng)我們從Python官方網(wǎng)站下載并安裝好Python 2.7后,我們就直接獲得了一個(gè)官方版本的解釋器:CPython。這個(gè)解釋器是用C語言開發(fā)的,所以叫CPython。在命令行下運(yùn)行python就是啟動(dòng)CPython解釋器。
CPython是使用最廣且被的Python解釋器。教程的所有代碼也都在CPython下執(zhí)行。
PyPy
PyPy是另一個(gè)Python解釋器,它的目標(biāo)是執(zhí)行速度。PyPy采用JIT技術(shù),對Python代碼進(jìn)行動(dòng)態(tài)編譯(注意不是解釋),所以可以顯著提高Python代碼的執(zhí)行速度。
絕大部分Python代碼都可以在PyPy下運(yùn)行,但是PyPy和CPython有一些是不同的,這就導(dǎo)致相同的Python代碼在兩種解釋器下執(zhí)行可能會(huì)有不同的結(jié)果。如果你的代碼要放到PyPy下執(zhí)行,就需要了解PyPy和CPython的不同點(diǎn)。
4 第一個(gè)Python程序
1.文件執(zhí)行
2.交互器執(zhí)行:調(diào)試用的
C:\Users\Administrator\Desktop>python Python 3.5.4 (v3.5.4:3f56838, Aug 8 2017, 02:17:05) [MSC v.1900 64 bit (AMD64)]on win32 Type "help", "copyright", "credits" or "license" for more information. >>> >>> print("Hello World") Hello World >>>5 精通各種語言的HelloWorld
C
#include <stdio.h> int main(void) { printf("\nhello world!"); return 0; }?
C++
#include <iostream>int main(void){std::cout<<"Hello world";}?
JAVA
public class HelloWorld{// 程序的入口public static void main(String args[]){// 向控制臺(tái)輸出信息System.out.println("Hello World!");} }?
PHP
<?php echo "hello world!"; ?>?
Ruby
日本人開發(fā)的,敏感時(shí)期容易挨Kputs "Hello world."?
GO
package mainimport "fmt"func main(){fmt.Printf("Hello World!\n God Bless You!");}?
轉(zhuǎn)載于:https://www.cnblogs.com/Mobai-c/p/10007753.html
總結(jié)
以上是生活随笔為你收集整理的2 Python 介绍的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 几个数字的和
- 下一篇: 创建python虚拟环境,安装djang