[Python is not a python] Understanding Python | History of Python development | Advantages and disadvantages of Python

Ⅰ.Get to know Python

0x00 How did Python come about?

        ABC language is an interactive, structured high-level language developed by Leo Grurts, Lambert Meertens, and Steven Pemberton of CWI ( Dutch National Center for Mathematics and Computer Science ) under the NWO (Netherlands Scientific Research Organization) , aiming to replace BASIC and Pascal. and other languages ​​for teaching and prototyping software design. -- Baidu Encyclopedia

Aren't we talking about Python? What does this have to do with ABC language?

Our python founder, Guido van Rossum , once participated in the development of the ABC language.

During the Christmas period         of 1989 , in Amsterdam , Guido decided to develop a new script interpreter as an inheritance of the ABC language in order to kill the boredom of Christmas .

        In Guido's opinion, the language ABC is very beautiful and powerful, and is specially designed for non-professional programmers. However, the ABC language did not succeed. The reason, Guido believes, is that it is not open. Guido is determined to avoid this mistake in Python. At the same time, he also wanted to achieve something that had been flashed in ABC but never realized.

        In this way, one Christmas, a computer, and the famous Python was born! ! !

Wait, just one Christmas, Python was created?

Yes, the great god is so awesome

 

 0x01 Why is it called Python?

Python’s founder, Guido van Rossum, is an energetic and hilarious person. After obtaining a master's degree in mathematics and computer science from the University of Amsterdam in 1982, he worked in various scientific research institutions. He worked at Google for 7 years from 2005 to 2012, and then left to join Dropbox. The 60-year-old Dutch programmer designed the world-popular programming language Python during his Christmas vacation at the age of 34 (1989). Although the original meaning of Python is a boa constrictor, the founder obviously did not want to show that this language can become a white lady who meets you at the West Lake. Regarding the naming of Python, Guido himself said this (in 1996):

"Six years ago in December of 1989, I was looking for an 'after school' programming project to fill my time during the holidays around Christmas. My office was closed for the holidays, but I had a home computer. I decided to do it for the time I was working on. Conceive of writing an interpreter in a new scripting language that is a descendant of the ABC language and would be attractive to UNIX/C programmers. As a person with slightly strange ideas and "Monty Python's Flying Circus" Being a big fan of Python, I chose Python as the title of the project.”

0x02 What is "Monty Python's Flying Circus"?

Namely: the comedy group Monty Python. They wanted to find a smoother-sounding surname for this name, so they chose "Python". After this plan was proposed, the BBC's view on the name "Monty Python" was: "It is a perfect name for a vulgar entertainment group . "

 Ⅱ.Development History of Python

0x00 Python version development history

Python version development history

release version

from

years

owner

GPL compatible

0.9.0 to 1.2

n/a

1991-1995

CWI

yes

1.3 to 1.5.2

1.2

1995-1999

CNRI

yes

1.6

1.5.2

2000

CNRI

no

2.0

1.6

2000

BeOpen.com

no

1.6.1

1.6

2001

CNRI

no

2.1

2.0+1.6.1

2001

PSF

no

2.0.1

2.0+1.6.1

2001

PSF

yes

2.1.1

2.1+2.0.1

2001

PSF

yes

2.1.2

2.1.1

2002

PSF

yes

2.1.3

2.1.2

2002

PSF

yes

2.2 to 3.

2.1.1

2001 to present

PSF

yes

3.0 and higher

2.6

2008 to present

PSF

yes

                                                                                                                             ——From Baidu Encyclopedia

0x01 Python programming language rankings 

In June 2023, there will be little change in the TOP 20. The top ten are:

Python,C,C++,Java,C#,Visual Basic, JavaScript,PHP,SQL,Assembly language。

Python, C, C++, Java, C#, Visual Basic, JavaScript, PHP, SQL, Assembly language historical change curve chart, thanks to the development of artificial intelligence Python has developed very rapidly, and has fallen back recently: programming languages ​​ranked 21-50

Historical ranking of major programming languages ​​(1988-2023)

Programming Language "Celebrity List" (2003-2022)

 It can be seen that Python is at the top of the world's programming language rankings because it is easy to learn.

 Ⅲ. Python advantages and disadvantages

advantage

Simplicity : Python is a language that represents the idea of ​​simplicity . Reading a good Python program feels like reading English. It allows you to focus on solving problems rather than figuring out the language itself.

Easy to learn : Python is extremely easy to get started because Python has extremely simple documentation [8]   .

Easy to read and maintain : clear and consistent style, forced indentation

Has many uses

Faster: The bottom layer of Python is written in C language, and many standard libraries and third-party libraries are also written in C, which runs very fast. [7] 

Free and open source : Python is one of FLOSS (Free/Open Source Software). Users are free to distribute copies of this software , read its source code, make changes to it, and use parts of it in new free software. FLOSS is based on the concept of a group sharing knowledge.

High-level language : When writing programs in Python, you don't need to worry about low-level details such as how to manage the memory used by your program.

Portability : Due to its open source nature, Python has been ported on many platforms (with modifications to enable it to work on different platforms). These platforms include Linux , Windows, FreeBSD , Macintosh, Solaris , OS/2, Amiga, AROS, AS/400 , BeOS, OS/390, z/OS , Palm OS, QNX, VMS, Psion, Acom RISC OS, VxWorks, PlayStation , Sharp Zaurus, Windows CE, PocketPC, Symbian and Google's android platform based on Linux.

Interpretability : A program written in a compiled language such as C or C++ can be converted from a source file (i.e., C or C++ language) into a language used by your computer (binary code, i.e., 0s and 1s). This process is done through the compiler and different flags and options.

When you run a program, the linker/reprinter software copies your program from the hard drive to memory and runs it. Programs written in Python do not need to be compiled into binary code . You can run programs directly from source code.

Inside the computer, the Python interpreter converts the source code into an intermediate form called bytecode, which is then translated into the machine language used by the computer and run. This makes using Python much simpler. It also makes Python programs more portable.

Object-oriented : Python supports both procedural and object-oriented programming. In "procedural-oriented" languages, programs are built from procedures or simply functions that are reusable code. In "object-oriented" languages, programs are built from objects that combine data and functionality.

Python is a completely object-oriented language. Functions , modules, numbers, and strings are all objects. And it fully supports inheritance, overloading, derivation, and multiple inheritance, which is beneficial to enhance the reusability of source code. Python supports overloaded operators and dynamic typing. Compared with Lisp , a traditional functional programming language, Python only provides limited support for functional design. There are two standard libraries (functools, itertools) that provide tried and tested functional programming tools in Haskell and Standard ML.

Scalability and extensibility : If you need a key piece of code to run faster or you want some algorithms not to be made public, you can write part of the program in C or C++ and then use them in a Python program.

Python itself is designed to be extensible. Not all features and functionality are integrated into the language core. Python provides a wealth of APIs and tools so that programmers can easily use C language , C++ , and Cython to write expansion modules. The Python compiler itself can also be integrated into other programs that require a scripting language. Therefore, many people also use Python as a "glue language". Use Python to integrate and encapsulate programs written in other languages. Many projects within Google, such as Google Engine, use C++ to write parts with extremely high performance requirements, and then use Python or Java/Go to call the corresponding modules. Alex Martelli, author of "Python Technical Manual" said: "It's hard to say, but in 2004, Python was already used internally at Google. Google recruited many Python experts, but it had already decided to use Python before that. , their purpose is Python where we can, C++ where we must, use C++ when controlling hardware , and use Python during rapid development."

Embeddability : Python can be embedded into C / C++ programs to provide scripting functionality to program users.

Rich library : The Python standard library is indeed huge. It can help with a variety of tasks, including regular expressions, document generation, unit testing, threads, databases, web browsers , CGI, FTP, email , XML, XML-RPC, HTML, WAV files, cryptography, GUI ( Graphical user interface), Tk and other system-related operations. This is called Python's "full-featured" philosophy. In addition to the standard library, there are many other high-quality libraries, such as wxPython, Twisted, and the Python imaging library, among others.

Standardized code: Python uses forced indentation to make the code more readable. Programs written in Python do not need to be compiled into binary code. The author of Python designed a very restrictive syntax so that bad programming habits (such as not indenting the next line to the right in an if statement) cannot be compiled. One of the most important ones is Python's indentation rules. One difference from most other languages ​​(such as C) is that the boundaries of a module are completely determined by the position of the first character of each line in this line (while C language uses a pair of curly brackets to clearly define the module The boundaries have nothing to do with the position of the characters). By forcing programmers to indent (including if, for, and function definitions where modules are used), Python does make programs clearer and more beautiful.

Advanced dynamic programming: Although Python may be roughly classified as a "script language" (script language), it is actually used extensively by some large-scale software development projects such as Zope, Mnet and BitTorrent , and Google . Supporters of Python prefer to call it a high-level dynamic programming language. The reason is that "scripting language" generally refers to a language that only performs simple programming tasks, such as shellscript, VBScript and other programming languages ​​​​that can only handle simple tasks and cannot be compared with Python. Python is comparable.

There are many advantages to doing scientific calculations: When talking about scientific calculations, the first thing that will be mentioned may be MATLAB. Except for some highly professional toolboxes of MATLAB that cannot be replaced, most of the common functions of MATLAB can be found in the corresponding extension libraries in the Python world. Compared with MATLAB, using Python for scientific calculations has the following advantages:

●First of all, MATLAB is a commercial software and is expensive. Python is completely free, and many open source scientific computing libraries provide Python calling interfaces. Users can install Python and most of its extension libraries for free on any computer.

●Secondly, compared with MATLAB , Python is an easier to learn and more rigorous programming language. It allows users to write code that is more readable and maintainable.

●Finally, MATLAB is primarily focused on engineering and scientific computing. However, even in the computing field, various needs such as file management, interface design, and network communication are often encountered. Python has a rich extension library that can easily complete various advanced tasks. Developers can use Python to implement various functions required for complete applications.

shortcoming

Problems with single-line statements and command line output : Many times the program cannot be written in one line, such as import sys; for i in sys.path: print i. Perl and awk do not have this restriction. They can easily complete simple programs under the shell. They do not need to write the program into a .py file like Python.

Confusing to beginners: The unique syntax may not be called a limitation, but the way it uses indentation to distinguish statement relationships still brings confusion to many beginners. Even experienced Python programmers can fall into traps.

Slow running speed : compared to C and C++. Python developers try to avoid immature or unimportant optimizations. Patches that speed up non-critical parts of the code are usually not incorporated into Python. So many people think Python is slow. However, according to the 80/20 rule , most programs do not have high speed requirements. In some situations where running speed is very high, Python designers tend to use JIT technology, or rewrite this part of the program in C / C++ language. The available JIT technology is PyPy .

Difference from other languages

As long as there is a best way to solve a particular problem

This is expressed in the Python maxim written by Tim Peters (called The Zen of Python): There should be one-and preferably only one-obvious way to do it. This is exactly the opposite of the central idea of ​​TMTOWTDI (There's More Than One Way To Do It) in Perl language (another high-level dynamic language with similar functions).

Python's design philosophy is "elegant", "clear" and "simple". Therefore, the Perl philosophy of "there are always multiple ways to do the same thing" is often unbearable among Python developers. The philosophy of Python developers is "do one thing in one way, and preferably only one way." When designing the Python language, if faced with multiple choices, Python developers will generally reject fancy syntax and choose clear syntax with little or no ambiguity. Due to this difference in design concepts, Python source code is generally considered to be more readable than Perl and can support large-scale software development. These guidelines are called Python mottos. Run import this within the Python interpreter to get the complete list.

More advanced Virtual Machine

When Python is executed, it will first compile the source code in the .py file into Python byte code, and then the Python Virtual Machine (Python virtual machine) will execute these compiled byte codes. The basic idea of ​​this mechanism is consistent with Java and .NET. However, the difference between Python Virtual Machine and Java or .NET Virtual Machine is that Python Virtual Machine is a more advanced Virtual Machine. Advanced here is not advanced in the usual sense. It does not mean that Python's Virtual Machine is more powerful than Java or .NET. It means that compared with Java or .NET, Python's Virtual Machine is further away from the real machine. Or it can be said that Python's Virtual Machine is a Virtual Machine with a higher abstraction level. Bytecode files compiled from C-based Python , usually in .pyc format. In addition, Python can also be run in interactive mode. For example, mainstream operating systems Unix/ Linux , Mac, and Windows can directly run the Python interactive environment in command mode. Interactive operations can be achieved by directly issuing operating instructions.

                                                                                                                                   -- Baidu Encyclopedia

 

Guess you like

Origin blog.csdn.net/m0_73552311/article/details/132721748