001Python and Python interpreter

Python and Python interpreter

A, Python Introduction

Python founder of Guido van Rossum (Guido van Rossum), as shown below, the founder of the few language is not bald. During Christmas 1989, Guido Christmas in order to pass the boredom, he began to write Python language syntax can explain interpreter. The name Python, Guido from the beloved TV series Monty Python's Flying Circus. He hoped that this new language called Python, able to meet his ideal: to create a C shell and between, full-featured, easy to use, scalable language.

TIOBE latest rankings, Python catch PHP occupy the first 4, Python advocating beautiful, clear, simple language is an excellent and widely used.

Python is used in many fields, such as: data analysis, component integration, many networking services, image processing, numerical calculation and scientific computing. Almost all of the Internet industry's medium-sized enterprises are using Python, such as: Youtube, Dropbox, BT, Quora (China know almost), watercress, know almost, Google, Yahoo, Facebook, NASA, Baidu, Tencent, car home,! US group and so on.

Be sure to note that we are talking about Python, in fact, that is the Python interpreter.

Two, Python interpreter development history

Python just come out when the majority of the company's existing software is Python2. +, Due to the development costs of software needs, so some companies can not abandon the previous code, it has launched 3 + version of Python in 2008, the need 2. + version launched an upgraded version of the company 2. + excessive period of time version of development. But the company's software life cycle, legacy 2. + development software will gradually disappear, so 2 + version is not updated, after consistent use 3. + version.

  • In 1989 Guido started writing Python language compiler.
  • In 1991, the first born Python compiler. It is written in C language and be able to call the C language library. From birth, Python already has: classes, functions, exception handling, core data types, including tables and dictionaries, as well as expansion module-based system.
  • Granddaddy of Python web frameworks, Zope 1 was released in 1999
  • Python 1.0 - January 1994 increased by lambda, map, filter and reduce.
  • Python 2.0 - October 16, 2000, joined the memory recovery mechanism, forms the basis of the framework of the Python language is now
  • Python 2.4 - November 30, 2004, the same year the most popular of the birth of Django framework WEB
  • 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 (here to explain why in 2008 on the 30, in 2010 but launched a 2.7 because 3.0 is not backwards compatible with 2.0, resulting in everyone refused to upgrade 3.0, but unfortunately the official can only launch 2.7 Transitional version)
  • 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 released version Python3.6.0
  • Python 3.7 - 2018-6-27 release version Python3.7.0
  • Python 3.8 - 2019-2-4 released a beta version of Python 3.8.0.a1

Three, Python interpreter type

We now know that when Python an interpreted language, want to run the code must be executed by an interpreter, the Python interpreter itself can be seen as a program (a translator is not important which country), this program is the development of what language it? The answer is several languages? There are several Python interpreter were developed based on different languages, different characteristics of each of the interpreters, but we can run Python code properly, these differences were watching all kinds of different types of Python interpreter below

3.1CPython

Cpython is to use and is the most widely used Python interpreter. This tutorial is subject to Cpython. When we download and install Python 2.7 from Python's official website, we have direct access to an official version of the interpreter: CPython. The interpreter is a C language development, so called CPython. In order to run Python is launched CPython interpreter.

3.2IPython

IPython is another Python interpreter, which is the target speed of execution. PyPy using JIT technology, Python dynamically compiled code (note not explained), it is possible to significantly improve the execution speed of the Python code.

The vast majority of Python code can be run under PyPy, but PyPy and CPython something different, which leads to the same Python code executed by an interpreter in two different results. If your code into PyPy under execution, we need to understand the different points of PyPy and CPython.

3.4Jython

Jython Python interpreter is running on the Java platform, Python code can be directly compiled into Java bytecode execution.

3.5 IronPython

IronPython and Jython similar, but IronPython Python interpreter is running on the Microsoft .Net platform, Python code can be directly translated into .Net byte code.

Fourth, the first Python program

Command line, type python, then enter print('hello world'), then pay tribute to the great phrase! If it is successful, it means that your Python installation without any problems. At this point you can think of that moment invention of the computer, the computer outputs a "hello world"

Five other languages ​​Hello World

Next we look at other languages ​​hello world, let you experience the simple python.

5.1 C++

#include<iostream>
int main(void){
 stdout<"Hello World";
}

5.2 C

#include<stdio.h>
int main(void){
  printf("\n Hello World");
  return 0;
}

5.3 Java

public calss HelloWorld{
  //程序入口
  public static void main(String args[])
  {
    //打印输出
    System.out.printIn("Hello World");
  }
}

5.4 PHP

<?php
    echo "Hello World!";
  ?>

5.5 Ruby

# 日本人发明 
puts "Hello World"

5.6 GO

package main
import 'fmt'
func main(){
  fmt.Printf("Hello World\n");
}

Original from https://www.cnblogs.com/nickchen121/p/10722729.html

Guess you like

Origin www.cnblogs.com/FirstReed/p/11701120.html