Python It is one of the most popular interpretive programming languages in the world .Python from Guido van Rossum Design , As “ABC” The successor of the programming language , On 1991 First released in 2004 . It is a high-level common language , The design idea is to emphasize the readability of the code by using indentation .Python The language structure is designed to help programmers write logic code for small and large projects .
The language is dynamically typed , Support multiple programming paradigms . It fully supports object-oriented and structured programming , Some of its features support functional and Aspect Oriented Programming .
Python Designed as a highly extensible language . This modularity makes it popular as a way to add interfaces to existing applications . Because of its comprehensive standard library , It is usually described as “ Contains batteries ” Language . We need to thank ABC This feature provided , because Python The designer's vision of a small core language with a large standard library stems from his vision of ABC The frustration of language , and ABC Language is based on the opposite approach .
Python The format is visually neat , And often use keywords ; However , Many other languages rely on punctuation .Python Another significant difference is that it does not use braces to separate blocks . And C Compared with other languages , Its syntax exceptions and special cases are much less .
Python Use space indentation to separate blocks . Indentation may be added after some statements , But the reduction in indentation means the end of the program segment . This makes the visual structure of the program accurately represent the semantic structure of the program .
This feature is called “ Offside rule ”. It may not be python Unique , But with semantics ; On the other hand , Indentation in most languages has no semantic meaning .
stay Python in , The variable name is a reference holder , There is no fixed data type associated with it . They can bounce back to any object at any time . Although at a given time , Variable will reference an object , The object itself has type . This is called dynamic typing .
This is related to Java、C++、FORTRAN、Scala and Pascal And other languages are exactly the opposite , Because they are statically typed programming languages , Each of these variables can only contain a specific type of value .
Expressions are grammatical entities in programming languages , It can be evaluated to determine its value . It is a constant that the programming language interprets and calculates to produce values 、 Variable 、 A combination of functions and operators .
stay Python in , Expressions and statements are different . in other words , A statement cannot be part of an expression . This feature is not common , Because it doesn't exist in some major languages , such as Scheme、Common Lisp or Ruby. But this can lead to duplication of certain functions .
Python Use duck type , This is an application that determines whether an object can be used for a specific purpose . In this language , Type constraints are not checked at compile time . Failure to perform an operation on an object means that the given object is not of the appropriate type .
Python Is a strong type of language , Therefore, it does not allow undefined operations , Instead of trying to understand them silently .
It allows programmers to define their own types using classes . You can call a class to construct a new instance of the class .
there “ Method ” Is the process associated with messages and objects . An object consists of data and behavior ; These include an interface , This interface specifies how the object is used by any of its consumers .
Python Method has an explicit self Parameter to access instance data .Python Methods are also provided , Often referred to as dunder Method , Allow user-defined classes to modify how they are handled by local operations , For example, length 、 Compare 、 Arithmetic operations 、 Type conversion, etc .
Python There is a large library of standards . It can provide tools for many tasks . It includes tools for creating graphical user interfaces (GUI)、 Connect to a relational database 、 Generate pseudo-random numbers 、 Operate on regular expressions 、 Module of unit test, etc .
Most standard libraries are cross platform Python Code , Therefore, only a few modules need to be changed or rewritten for variant implementation .
Python It can be used as Web The scripting language of the application . With Web Server gateway interface , standard API It has been developed to promote these applications .
NumPy、SciPy and Matplotlib Such libraries allow for efficient use in scientific computing Python.Biopython and Astropy And other libraries provide domain specific functions .SageMath It's a computer algebra system , With can be used in Python Notebook interface programmed in . Its library can cover all aspects of Mathematics , For example, algebra 、 Combine 、 Numerical Mathematics 、 Number theory and calculus .
stay TensorFlow、Keras、Pytorch and Scikit-learn With the help of Library ,Python It is often used in artificial intelligence projects and machine learning projects .Python Because of its modular architecture 、 Simple syntax and rich text processing tools are often used in natural language processing .
Python It can also be used to create games , Use Pygame Wait for the library to make 2D game .
GNU Debugger Use Python As a beautiful printer to display complex structures , for example C++ Containers .Esri take Python Popularized as in ArcGIS The best choice for scripting in . It has been used as Google App Engine The first of the three programming languages available in .
Many operating systems will Python As a standard component . It goes with most Linux The distribution comes with , And you can use... From the command line terminal . many Linux The distribution uses Python Written installer . for example ,Ubuntu Use Ubiquity Erection sequence , and Red Hat Linux and Fedora Use Anaconda Erection sequence .
Python It is also widely used in the information security industry , Including exploit development .
since 2003 Since then ,Python It has always been among the top ten most popular programming languages . It's in 2007 year 、2010 year 、2018 Years and 2020 It was named the programming language of the year , Is the only language to win the award four times .
Only in the past three years ,Python There has been a significant increase in the value of . For the foreseeable future , It has not lost its value . therefore , Study Python It's definitely worth your time and energy .