The development history of python

With the popularity of artificial intelligence and big data, python once became a hot technical direction. Why can Python get the programming language that many Internet workers are passionate about? First of all, we must understand the development process of Python, so as to better judge the important role of Python in each stage of development.

The birth of Python


  Python was developed by Dutchman Guido van Rossum. Guido van Rossum received a master's degree in mathematics and computer science from the University of Amsterdam in 1982. At that time, Guido was working at CWI (National Institute of Mathematics and Computer Science), mainly contributing codes to the ABC language. After working for a period of time, he felt that the existing programming language It is very unfriendly to non-computer professionals, so in December 1989, he conceived a programming language dedicated to solving problems, which is the original source of Python.


  In 1991, Python's first interpreter was born. It is implemented in C language and is influenced by ABC language, so many of its grammars are derived from C language and ABC language. The Python 1.0 version was actually released in January 1994. The main new features of this version are lambda, map, filter and reduce.


  The Python 2.0 version was released in October 2000, six and a half years later. The main new features of this version are memory management, cycle detection garbage collector and support for Unicode, which form the basis of the current Python language framework. Then in 2004, Python was upgraded to version 2.4, and the most popular web framework Django was born in the same year. After that, Python successively pushed Python2.5/2.6/2.7 versions. Up to now, many enterprises are still using Python2.7 version. However, starting from January 1, 2020, Python 2.x versions will no longer be supported. Python's core developers will no longer provide its bug fixes or security updates, and Python 2.x is about to enter the paid era.


  At present, the mainstream application of Python development is Python3.x version, but many codes of Python3 and Python2 versions are incompatible, so it is recommended that if you want to learn the Python programming language, you can start directly from the latest version of Python. Currently the most popular version of Python is version 3.10.
 

Next, explain the difference between python2.X and python3.0X versions:

1. Core differences
  1. There are two types of strings in Python2: str and Unicode, while Python3 only supports strings under Unicode.
  2. Absolute paths are used in Python3 to import.
  3. Python3 is more strict about indentation, and the coexistence of tab and space will cause an error TabError. In Python2, a tab is equivalent to 8 spaces.


2. Discarding differences
  1. The print statement is discarded in Python3, and the print function is used uniformly;
  2. The exec statement is discarded in Python3, and the exec function is uniformly used;
  3. The execfile statement is discarded in Python, and it is recommended to use exec(open(“./filename”) .read())
  4. In Python3, "<>" is discarded to indicate inequality, and "!=" is used uniformly.
  5. In Python3, the long certificate type is discarded, and int is used uniformly
  . 6. In Python3, the Xrange function is discarded, and range is uniformly used, and range The mechanism modifies and improves the generation efficiency of large data sets.
  7. The list object is no longer returned in Python3.
  8. The next() function of iterator is discarded in Python3, and next(iterator) is used uniformly.
  9. The raw_input function is discarded in Python3, and the input function is uniformly used.
  10. The file function is discarded in Python3, and the open function is uniformly used Process files.
  11. The apply function is discarded in Python3.
  12. StandardError is abandoned in Python3, and Exception is used uniformly


  In addition to these differences, Python3 also has some changes in some syntax and basic operations. For the use of Python, the most important changes are major changes in third-party toolkits, system installation support, etc. due to version incompatibility.
  If you are a beginner, it is recommended that you learn the Python3 version directly, and have a little understanding of the Python2 version. If you encounter Python2 version related development work in your future work, you can use the Python3 version for development according to the Python2 specification. . For students who are developing using the Python2 version, it is recommended that you become familiar with the differences between Python2 and Python3 as soon as possible, and migrate your programs as soon as possible.
  
  
  Extended reading:
  >ABC language: ABC language is a research project for programming beginners. Language, designed to replace BASIC, Pascal and other languages, for teaching and prototyping software design. Guido van Rossum, the father of Python, has worked on the development of the ABC system for several years. It's just for understanding here.
  >lambda: A lambda expression is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types.
  >map: The map() function will map the specified sequence according to the provided function.
  >filter: The filter() function is used to filter the sequence, filter out elements that do not meet the conditions, and return a new list composed of elements that meet the conditions.
  >reduce: The reduce() function will accumulate elements in the parameter sequence.
  >Django: Django is an open source web application framework that adopts MTV's framework pattern, namely model M, attempt V and template T. The main purpose is to develop database-driven websites easily and quickly. Emphasis on code reuse, multiple components can easily serve the entire framework in the form of plug-ins.

Guess you like

Origin blog.csdn.net/heyang00088/article/details/130294279