Introduction to the development history of Python

零下一度
Release: 2017-07-19 16:09:27
Original
6092 people have browsed it

1. Development history of Python

Python language is loved by many people in the IT industry because of its concise and clear style, as well as a large number of widely applicable class libraries and python open source frameworks that can be used. What is the origin and development history of Python? Let’s take a brief look at it.

Tracing back to the origins of the Python language, it was a new script interpreter developed by Guido van Rossum in Amsterdam in the early 1990s. I wonder if Guido ever thought that Python would one day become one of the most popular programming languages?

Some people like to use glue language to describe Python because it can easily combine modules written in many other languages. As for the process, I won’t go into details here. If you are interested, you can find it anywhere. . What you need to know is that many universities at home and abroad also take the Python language as a required course, and the number of domestic units that use the Python language to work is also increasing. Programmers who know Python are in hot demand.

I would like to ask my friends who have learned Python language, what are its attractive features? Most people would think that it is a language that is easy to use, easy to read and easy to maintain, so many users like to use and learn it. It is really a language with a wide range of uses.

The most basic syntax of Python language is: indentation, control statements, expressions, functions, object methods, types and mathematical operations. Only after learning the basic syntax of Python can you start learning formal applications, such as: practical applications of graphics processing, mathematical processing, text processing, databases, WEB programming, crawlers, etc.

Python 3.3 is the latest version, but many people still like to start learning from Python 2. Because it has been said before that the third-party support for Python 3 is not yet complete, you will encounter inexplicable problems during the learning process. It is better to start learning from python 2, which is already very complete. The transition to python 3 will be easy after that.

HOW TO is used to define a function. A Python programmer should easily understand this program. ABC language uses colons and indentation to represent blocks of programs. There is no semicolon at the end of the line. There are also no parentheses () in the for and if structures. Assignment uses PUT instead of the more common equal sign. These changes make the ABC program read like a text. Despite its good readability and ease of use, the ABC language ultimately failed to become popular. At that time, the ABC language compiler required a relatively high-end computer to run. The users of these computers are usually computer proficient, and they consider the efficiency of the program more than the difficulty of learning it. In addition to hardware difficulties, the design of the ABC language also has some fatal problems: poor scalability. ABC language is not a modular language. If you want to add functions to the ABC language, such as graphical support, you must change many places. IO cannot be performed directly. ABC language cannot directly operate the file system. Although you can import data through methods such as text streams, ABC cannot read or write files directly. The difficulty of input and output is fatal to computer languages. Can you imagine a sports car with doors that can't be opened? Over-innovation. ABC uses natural language to express the meaning of the program, such as HOW TO in the above program. However, for programmers, they are more accustomed to using function or define to define a function. Likewise, programmers are more accustomed to using the equal sign to assign variables. Although the ABC language is very special, it is also very difficult to learn. Difficulty in spreading. The ABC compiler was large and had to be saved on tape. When Guido visited at that time, he had to have a large tape to install the ABC compiler for others. In this way, it is difficult for ABC language to spread quickly. In 1989, in order to pass the Christmas vacation, Guido started writing a compiler for the Python language. The name Python comes from Guido's beloved TV series Monty Python's Flying Circus. He hopes that this new language called Python can meet his ideal: to create a language between C and shell that is comprehensive, easy to learn, easy to use, and scalable. As a language design enthusiast, Guido has already tried to design languages. This time, it was nothing more than a pure act of hacking.

The birth of a language

In 1991, the first Python compiler was born. It is implemented in C language and can call C language library files. From its birth, Python has had: classes, functions, exception handling, core data types including tables and dictionaries, and a module-based expansion system. Much of Python's syntax comes from C, but it is also strongly influenced by the ABC language. Some rules from the ABC language are controversial to this day, such as forced indentation. But these syntax rules make Python easy to read. On the other hand, Python smartly chooses to obey some conventions, especially those of the C language, such as regressing the equal sign assignment. Guido believes that if something is established based on "common sense", there is no need to get too hung up on it. Python has paid special attention to scalability from the beginning. Python can be extended on multiple levels. At a high level, you can import .py files directly. Under the hood, you can reference C libraries. Python programmers can quickly use Python to write .py files as expansion modules. But when performance is an important factor to consider, Python programmers can go deep into the bottom layer, write C programs, compile them into .so files and introduce them into Python for use. Python is like building a house with steel. First define the large frame. Programmers can expand or change quite freely within this framework. The original Python was developed entirely by Guido himself. Python is popular among Guido's colleagues. They provide quick feedback and participate in Python improvements. Guido and some colleagues form the core team of Python. They spend most of their spare time hacking Python. Subsequently, Python expanded beyond the institute. Python hides many machine-level details and leaves them to the compiler to handle, and highlights logical-level programming thinking. Python programmers can spend more time thinking about the logic of the program instead of specific implementation details. This feature attracts a large number of programmers. Python became popular.

The Times Make Heroes

We have to pause our Python time and take a look at the ever-changing computer industry. In the early 1990s, personal computers began to enter ordinary households. Intel released the 486 processor, and Windows released a series of window systems starting with window 3.0. Computer performance is greatly improved. Programmers began to pay attention to the ease of use of computers, such as graphical interfaces.

Windows 3.0

As computer performance improves, the world of software begins to change. The hardware is sufficient for many personal computers. Hardware manufacturers are even eager for the emergence of high-demand software to drive upgrading of hardware. C++ and Java became popular one after another. C++ and Java provide object-oriented programming paradigms and rich object libraries. At the expense of a certain amount of performance, C++ and Java have greatly improved program output. The ease of use of the language has been taken to a new level. We still remember that an important reason for the failure of ABC was the performance limitations of the hardware. In this respect, Python is much luckier than ABC. Another change that is happening quietly is the Internet. The 1990s was still the era of personal computers. Windows and Intel dominated the world with PCs and became very popular for a while. Although the Internet-based information revolution has not yet arrived, many programmers and experienced computer users are already frequently using the Internet to communicate, such as using email and newsgroups. The Internet has greatly reduced the cost of information exchange. A new software development model is becoming popular: open source. Programmers use their spare time to develop software and open source code. In 1991, Linus released the Linux kernel source code on the comp.os.minix news group, attracting a large number of hackers to join. Linux and GNU work together to form a vibrant open source platform. Hardware performance is not a bottleneck, and Python is easy to use, so many people are turning to Python. Guido maintains a maillist, and Python users communicate through email. Python users come from many fields, have different backgrounds, and have different needs for Python. Python is quite open and easy to expand, so when users are not satisfied with the existing functions, it is easy to expand or transform Python. Subsequently, these users send the changes to Guido, and Guido decides whether to add the new features to Python or the standard library. It would be a great honor if the code could be incorporated into Python itself or the standard library. Because of Guido's supreme decision-making power, he is known as the "Lifelong Benevolent Dictator." Python is called "Battery Included", which means that it and its standard library are powerful. These are contributions from the entire community. Python developers come from different fields, and they bring the advantages of different fields to Python. For example, the regular expressions in the Python standard library refer to Perl, while functions such as lambda, map, filter, and reduce refer to Lisp. Some features of Python itself and most of the standard library come from the community. The Python community continues to expand and has its own newsgroup, website, and fund. Starting from Python 2.0, Python has also changed from a maillist development method to a completely open source development method. A community atmosphere has been formed, work is shared by the entire community, and Python has also achieved faster development. As of today, the framework of Python has been established. The Python language organizes code with objects as the core, supports multiple programming paradigms, uses dynamic types, and automatically recycles memory. Python supports interpreted execution and can call C libraries for expansion. Python has a powerful standard library. Since the standard library system has stabilized, the Python ecosystem has begun to expand to third-party packages. These packages, such as Django, web.py, wxpython, numpy, matplotlib, and PIL, upgrade Python into a species-rich tropical rainforest.

Revelation

Python advocates elegance, clarity, and simplicity, and is an excellent and widely used language. Python ranks eighth in the TIOBE rankings. It is the third largest development language of Google, the basic language of Dropbox, and the server language of Douban. The development history of Python can be used as a representative and brings me a lot of inspiration. The community plays an important role in the development of Python. Guido thinks that he is not an all-round programmer, so he is only responsible for formulating the framework. If the problem is too complicated, he will choose to go around it, that is, cut the corner. These problems are ultimately solved by others in the community. The talents in the community are extremely rich. Even things that are slightly distant from development, such as creating websites and raising funds, there are people who are willing to handle them. Today's project development is becoming more and more complex and larger. Cooperation and an open mind have become the keys to the ultimate success of the project. Python has learned a lot from other languages, whether it is ABC that has entered history, or C and Perl that are still in use, and many other languages ​​​​not listed. It can be said that Python's success represents the success of all the languages ​​it draws from. Similarly, Ruby borrows from Python, and its success also represents the success of Python in some aspects. Every language is a hybrid, with its strengths and weaknesses. At the same time, the judgment of "good or bad" of a language is often subject to external factors such as platform, hardware, era, etc. Programmers experience many language battles. In fact, if you accept various languages ​​with an open mind, maybe one day programmers can mix their own languages ​​like Guido.

Key points common sense

The pronunciation and spelling of Python
Python means python, which comes from a TV series the author likes (where is C?)
The author of Python is Guido van Rossum ( Uncle Turtle)
Python is a programming language written in C by Uncle Turtle during the Christmas period of 1989 to kill the boring Christmas.
Python was officially born in 1991.
How many Python interpreters are there now? Language implementation, we commonly use CPython (the official version of C language implementation), others include Jython (can run on the Java platform), IronPython (can run on the .NET and Mono platforms), PyPy (implemented in Python, supports JIT Just-in-time compilation)
Python currently has two versions, Python2 and Python3. The latest versions are 2.7.12 and 3.5.2 respectively. At this stage, most companies use Python2

2. Advantages and Disadvantages of Python

Advantages

  • Simplicity——Python is a language that represents simplicity. Reading a good Python program feels like reading English, even though the English requirements are very strict! This pseudocode nature of Python is one of its greatest strengths. It allows you to focus on solving problems rather than figuring out the language itself.

  • Easy to learn——As you are about to see, Python is extremely easy to get started. As mentioned earlier, Python has an extremely simple syntax.

  • Free and open source————Python is one of FLOSS (Free/Open Source Software). Simply put, you 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. This is one of the reasons why Python is so great - it was created and constantly improved by a group of people who want to see a better Python.

  • High-level language - When you write a program in Python, you don't need to think 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 to many platforms (with modifications to enable it to work on different platforms). If you are careful to avoid using system-dependent features, then all of your Python programs will run without modification on any of the platforms listed below. 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 and even PocketPC, Symbian and Google's Android platform based on Linux!

  • Explanatory --- This point requires some explanation. 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 your program, the linker/reloader software copies your program from the hard drive into 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. In fact, all this makes using Python simpler since you no longer need to worry about how to compile the program, how to ensure that the correct libraries are linked and reproduced, etc. Since you only need to copy your Python program to another computer and it will work, this also makes your Python program more portable.

  • Object-oriented————Python supports both process-oriented programming 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. Compared to other major languages ​​such as C++ and Java, Python implements object-oriented programming in a very powerful and simple way.

  • Scalability————If you need a critical piece of your code to run faster or want certain algorithms to be kept private, you can put part of your program in C or C++ Write and then use them in your Python programs.

  • Rich library——Python standard library is indeed huge. It can help you with various tasks, including regular expressions, document generation, unit testing, threads, databases, web browsers, CGI, FTP, email, XML, XML-RPC, HTML, WAV files, password systems, GUI (Graphical User Interface), Tk and other system-related operations. Remember, all of these features are available as long as Python is installed. 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.

  • Standard code——Python uses forced indentation to make the code extremely readable.

Disadvantages

Running speed, if you have speed requirements, rewrite the key parts in C++.
The domestic market is small (there are only some web2.0 companies that use Python as the main development tool in China). But as time goes by, many domestic software companies, especially game companies, have begun to use it on a large scale.
There is a lack of Chinese information (there are only a handful of good python Chinese information). Thanks to the community, several excellent textbooks have been translated, but there are many entry-level textbooks, and advanced content can only be viewed in English.
There are too many architecture choices (there is no official .net architecture like C#, and there is no such thing as ruby ​​due to its short history, so the architecture development is relatively concentrated. The Ruby on Rails architecture is unmatched in the development of small and medium-sized web programs). However, this also shows from another side that Python is relatively excellent, attracting more talents and many projects.

3. Python application scenarios

Web application development
Python is often used for Web development. For example, through the mod_wsgi module, Apache can run web programs written in Python. Python defines the WSGI standard application interface to coordinate communication between HTTP servers and Python-based Web programs. Some web frameworks, such as Django, TurboGears, web2py, Zope, etc., allow programmers to easily develop and manage complex web programs.

Automated scripts for operating system management and server operation and maintenance
In many operating systems, Python is a standard system component. Most Linux distributions as well as NetBSD, OpenBSD and Mac OS X have integrated Python, and you can run Python directly under the terminal. There are installers for some Linux distributions written in Python, such as Ubuntu's Ubiquity installer, Red Hat Linux and Fedora's Anaconda installer. Gentoo Linux uses Python to write its Portage package management system. The Python standard library contains multiple libraries that call operating system functions. Through the third-party software package pywin32, Python can access Windows COM services and other Windows APIs. Using IronPython, Python programs can directly call the .Net Framework. Generally speaking, system management scripts written in Python are better than ordinary shell scripts in terms of readability, performance, code reuse, and scalability.

Scientific Computing
NumPy, SciPy, and Matplotlib allow Python programmers to write scientific computing programs.

Desktop software
PyQt, PySide, wxPython, and PyGTK are powerful tools for quickly developing desktop applications in Python.

Server software (network software)
Python has perfect support for various network protocols, so it is often used to write server software and web crawlers. The third-party library Twisted supports asynchronous network programming and most standard network protocols (including clients and servers), and provides a variety of tools that are widely used to write high-performance server software.

Game
Many games use C++ to write high-performance modules such as graphics display, and use Python or Lua to write game logic and servers. Compared with Python, Lua has simpler functions and smaller size; while Python supports more features and data types.

Conception implementation, early product prototypes and iterations
YouTube, Google, Yahoo!, and NASA all use Python extensively internally.

The above is the detailed content of Introduction to the development history of Python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!