Enter the world of Python from here

Life is short, I use Python

									---Life is short,you need Python
  • The origin of Python
  • Why use Python?
  • Features of Python
  • Pros and cons of Python

The origin of Python

Guido van Rossum
Python is founder Guido. Fanluosumu (Guido van Rossum)

  • 1. During Christmas 1989, Guido. Fanluosumu (Guido van Rossum) In order to pass the time in Amsterdam, determined to develop a new interpreter , as a succession of ABC language ( feeling what is meant by cattle )

  • 2. ABC is a teaching language designed by Guido. From the perspective of Guido himself, ABC is a very beautiful and powerful language, which is specially designed for non-programmers. But the ABC language did not succeed. The reason is that Guido believes that it is caused by non-openness. Guido was determined to avoid this error in Python and achieved very good results.

  • 3. The reason why Python is chosen as the name of the program is that he is a fan of the BBC TV series-Monty Parson's Flying Circus.

  • 4. In 1991, the first Python interpreter was born. It was implemented in C language and was able to call C language library files

Interpreter (Science)

Interpreter

Computer programming language

Speaking of computer programming language, it is mainly divided into three categories: machine language, assembly language, and high-level language.

Machine language is a set of binary instructions that a computer can directly recognize and execute. Because it can be directly executed by the CPU, it is the fastest, but it requires us to remember the code of each instruction and the corresponding action. Think about it when we write the code, we operate a series of 01 sequences, which is difficult How big.

In order to overcome the shortcomings of machine language, people use some mnemonics to replace machine code, that is, use some acronyms that are close to the actual meaning to replace actions, such as ADD, SUB, MOV, etc. Progress can be easily written, but it still operates on the machine, which is closer to the bottom level than high-level programming languages, so assembly language is a low-level language.

Both machine language and assembly language are hardware-oriented operations, and they are dependent on the machine, and different devices may be written in different ways. However, the high-level language is a user-oriented language. As long as we write the program content and compile or interpret the program, we can operate the machine. The compiler or interpreter mentioned here is a translation tool that translates languages ​​that humans can understand into things that machines can understand.

Interpreted language VS compiled language

The common goal of interpreted languages ​​and compiled languages ​​is to convert the sentences we know (such as loops, judgments) into binary codes, and then give them to the computer for execution.

the difference

The most obvious difference between the two is that the compiled language means that after we write the program, we completely translate the code into a binary file and execute the program by executing the binary file; while the interpreted language does not have the process of converting to a binary file. It is when it is needed and when to compile. Some people say, what is the difference? I haven't finished talking yet. After the binary file is generated by the compiled language, the binary file can be executed directly, and the interpreted language needs to carry this interpreter at any time, and it must be on call. Therefore, there are differences in various aspects. The following are the more obvious differences that I understand

Performance aspect

Compiled language
Interpreted language

running speed
fast (binary file)
slow (execute while interpreting)
portability (cross-platform)
poor (execute error when CPU instruction system changes)
good (carry interpreter with you)
update
recompile
only explain Updated content
Safe
Good (no need to provide source code)
Poor (delivered together with source code)

Python interpreter

With the above description, I must know what is going on with the interpreter. The interpreter actually includes the compilation process, but this compilation process does not generate object code. The Python interpreter consists of a compiler and a virtual machine. The compiler converts the source code into bytecode, and then executes the bytecode line by line through the Python virtual machine.

Python program execution process:

1. When the .py file is executed, the python interpreter will be started.
2. The compiler interprets the source file into bytecode.
3. The virtual machine converts the bytecode into machine language and interacts with the operating system.
4. After the program runs, it will The bytecode is stored in a pyc file for subsequent direct execution

There are many types of python interpreters:

CPython: C language development, the most widely used, the default interpreter
IPython: an interactive interpreter based on CPython
PyPy: using JIT technology, dynamic compilation of python code, pursuit of execution speed
Jython: interpretation running on the Java platform It can be directly compiled into Java bytecode to execute IronPython: same as Jython, running on the .Net platform

Although there are so many interpreters, we still use CPython, and for Java and .Net platforms, network calls are more commonly used to interact. Personally, I often use IPython for testing, which is very convenient.

World Language Ranking

In October 2020, the programming language ranking list
Python is approaching the second place
. The popularity of Python is very close to the second place Java. The ranking rate this month is 11.28%, reaching a record high.

World Language Ranking

Top 20 in TIOBE Ranking in October 2020

Python ranking

Since the TIOBE list, C and Java have always occupied the top two positions. Python is a rising star and only rose to third place last year. According to the current trend, it is very likely that Python will surpass Java by the end of this year.

Guess you like

Origin blog.csdn.net/qq_44143350/article/details/109276073