Python history
The founder of python is Guido van rosum. During the Christmas Day of 1989, in Amsterdam, Guido was determined to develop a new script interpreter as an inheritance of the ABC language in order to make Christmas boring. Python is selected as the program name because it is a fan of the Monty Python flying circus.
ABC is a teaching language (not heard of) designed by Guido ). In Guido's opinion, ABC is a very elegant and powerful language designed specifically for non-professional programmers. However, the ABC language is not successful. The reason is that Guido believes that it is not open. Guido is determined to avoid this error in Python (indeed, it works well with other languages such as C, C ++ and Java ). At the same time, he also wants to implement things that flash in ABC but have never been implemented.
In this way, python was born in Guido (Thank you very much ). In fact, the first implementation is on a Mac machine. It can be said that python was developed from ABC and was mainly influenced by Modula-3 (another pretty beautiful and powerful language designed for small groups. It also integrates the Unix shell and C habits.
Python features
Python is a scripting language, and its syntax is easy to read. It has many excellent scripting languages: Explanatory, object-oriented, built-in high-level data structure, supporting modules and packages, supporting multiple platforms and scalability. It also supports interactive and graphical operations. Its syntax has many distinctive features. Next I will explain it separately:
Running Mode
Python can be run in command line or interactive mode. It also has a graphical integration environment, which makes Python development quite convenient. Now, many visual programming software written in Python has been used to implement functions like Delphi.
Object-oriented
Python is a real object-oriented language. It even supports exception handling. If you have learned Java, you should be familiar with it. However, other scripting languages, such as PHP, do not seem to have any. This makes the compilation of the program clearer without many error checks.
Modules and packages
This is more like Java. For Java support, you can understand jpython. Jpython is a python written in Java. It fully supports Java. In this environment, you can use Java class libraries freely.
Language extension
You can use C, C ++, or Java to write new language modules for python, such as functions. It can be directly compiled with python, or implemented using dynamic library loading. Someone specially compiled a tool that can automatically encapsulate function interfaces for python. This is swig (simplified wrapper and interface generator ), or do simple encapsulation and interface Builder (can be in http://www.cs.utah.edu /~ Beazley/swig ).
Interesting syntax
Guido believes that python syntax is very elegant. One of them is that the block statement is not a {} pair commonly used in the C language, or another symbol pair, but uses the near representation! Interesting. In this regard, Guido's explanation is: first, using the near representation reduces visual confusion and shortens the program, in this way, the scope of attention to basic code units is reduced. Secondly, it reduces the degree of freedom of the programmer and is more conducive to unified style, making it easier to read other people's programs. I think it is good. in C language, there are several kinds of braces behind the if statement. Different people like different things and it is better to unify them.
After the definition of each class or function, the first line can be a description statement without the annotator mark. For the statement followed by the block statement, it should be followed by a colon (:). A row of statements cannot be too long because there is no line terminator. If it is too long, you must use the line break (/). There are also some interesting examples, such as the following comparison processing, using the C language:
If (2 <A & A <5)
It can be expressed
If (2 <A <5 ):
Of course, it may not be of any benefit, but the beautiful language it claims is not imaginary. Others can learn about it by themselves.
What can Python do?
So what can Python do? I think everything works. If you want to create a GUI program in windows, python is competent. You can go to wxpython.org to check that it is a python extension library that can be used to implement cross-platform graphical programming. It supports windows and Unix/Linux. There are some demos on that website. You can take a look. Python can be used as CGI. Some home pages provide CGI support for python. There are still some games made using python. If you want to know more about Python, you can go to SourceForge to find Python-related projects. There are many things on them.
End
Python is still in its infancy in China, and few people study it. I hope interested comrades can join this line.