Get to know Python

Get to know Python

Life is short, I use Python —— Life is short, you need Python

01. Origin of Python

Python was founded by Guido van Rossum

  1. During Christmas in 1989, Guido Van Rossum decided to develop a new interpreter as a successor to the ABC language in order to pass the time in Amsterdam .

  2. ABC is a teaching language designed by Guido. In Guido's opinion, ABC is a very beautiful and powerful language, which is specially designed for non-professional programmers . But the ABC language did not succeed, and the reason, Guido thinks, is caused by non-openness. Guido is determined to avoid this error in Python, and has achieved very good results

  3. Python was chosen as the name of the program because he is a fan of the BBC TV series Monty Python's Flying Circus

  4. In 1991, the first Python interpreter was born, which is implemented in C language and can call C language library files

  • Compiled language : Before the program is executed, a special compilation process is required to compile the program into a file in machine language. It does not need to be re-translated at runtime, and the compiled result can be used directly. The program execution efficiency is high, it depends on the compiler, and the cross-platform performance is poor. such as C, C++

  • Interpreted language : The program written in the interpreted language is not compiled in advance, the program code is stored in text, and the code is directly executed sentence by sentence. When publishing the program, it seems that the compilation process is saved, but when running the program, it must be interpreted before running

Comparing compiled and interpreted languages

  • Speed  ​​- Compiled languages ​​execute faster than interpreted languages

  • Cross-platform  - Interpreted languages ​​are more cross-platform than compiled languages

1.2 Design Goals of Python

In 1999, Guido Van Rossum submitted a grant application to DARPA called "Computer Programming for Everybody" and later stated his goals for Python:

  • A simple and intuitive language and as powerful as the main competitors

  • Open source so anyone can contribute to it

  • Code is as easy to understand as plain English

  • Routine tasks for short-term development

Fundamentals of these ideas have come true, and Python has become a popular programming language

1.3 The Design Philosophy of Python

  1. Grace

  2. clear

  3. Simple

<!--> Run `import this` inside the Python interpreter for a complete list -->

  • The philosophy of Python developers is: one way, preferably only one way to do one thing

  • When faced with multiple choices, Python developers generally reject fancy syntax in favor of one that has no or little ambiguity

In the Python community, Guido is known as a "benevolent dictator"

03. Python Features

  • Python is a fully object-oriented language

    • Functions , modules , numbers , strings are all objects, in Python everything is an object

    • Full support for inheritance, overloading, multiple inheritance

    • Support overloaded operators, also supports generic design

  • Python  has a powerful standard library . The core of the Python language only contains  common types and functions such as numbers , strings , lists , dictionaries , and files  . The Python standard library provides  system management , network communication , text processing , database interfaces , graphics  Additional features such as systems , XML processing , etc.

  • The Python community provides a large number of third-party modules that are used in a similar way to the standard library. Their functions cover  scientific computing , artificial intelligence , machine learning , web development , database interfaces , and graphics systems  .

04. Pros and cons of Python

4.1 Advantages

  • Simple and easy to learn

  • Free and open source

  • object oriented

  • rich library

  • Scalability

    • If you need a critical piece of code to run faster or if you want some algorithms to be private, you can use  C or  C++ write  this part of the Python program and use them in the program

  • ……

4.2 Disadvantages

  • running speed

  • Small domestic market

  • Lack of Chinese information

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325043216&siteId=291194637