This series is for yourself to learn Python notes. If there are errors, please correct me.
Python introduction
Introduction
Python is an interpreted, object-oriented language. It was invented by Guido van Rossum in 1989 and officially announced in 1991. Official website address: https://www.python.org
The Python word means big python, but Uncle Turtle does not like the name that pythons came up, but is chasing the drama: should be a TV comedy (Monty Python and the Flying Circus)
Use the interactive shell provided by www.python.org to learn the python shell
Features
-
Readable
Readability is far more important than it sounds. A program will be modified repeatedly. Strong readability means that you can learn and remember in a shorter time, which directly improves productivity.
-
concise
Studies have proved that the effective code that programmers can write every day is limited, and the same function can be completed with only half of the code, which actually doubles the productivity
Python is developed by the C language, but there are no more complex data types such as pointers in the C language. The simplicity of Python greatly reduces the difficulty of development and code, and the development tasks are greatly simplified. Programmers no longer need to pay attention to complex syntax. Focus on the task itself
To complete such a spiral, the code is only a few lines:
import turtle
t = turtle.Pen()
for x in range(360):
t.forward(x)
t.left(59)
-
Object-oriented
-
Free and open source
-
Portability and cross-platform
Python will be compiled into binary code related to the Yu operating system, and then interpreted and executed. This method is similar to java, which greatly improves the execution speed and realizes cross-platform
-
Rich library
Rich standard library, various extension libraries
-
Scalability
Can be embedded in C and C++ languages, glue language
Scope of application
-
Scientific Computing
-
artificial intelligence
-
WEB server and large website backend
YouTunbe gmail and other applications are developed based on python
-
GUI development (graphic user interface development)
-
game development
-
Mobile devices
-
Embedded device
-
System operation and maintenance
-
Big Data
-
cloud computing
When should you not use python
-
Python is interpreted and executed, with low performance
Therefore, some functions that affect performance can be developed using C/C++/JAVA/GO (GO is a language, written like python and performance like C)
But don’t worry that the Python interpreter will get faster and faster
Version and compatibility problem solution
There are currently two main versions: python2 and python3
Python2: Released in October 2000, the latest version is 2.7. The update has been stopped, and there will be no more after 2.8. It is expected to withdraw from the stage of history in 2020
Python2: Released in 2008, Python3 has been greatly improved and is not compatible with Python2
Compatibility problem solving
- Many new features of Python3 have also been ported to Python2.7. As a transition, if the program can run in 2.7, it can be seamlessly migrated to Python3 through a conversion tool called 2to3
- At present, it is recommended that you start directly from Python3
Python interpreter
The execution of Python programs depends on the Python interpreter. Commonly used Python interpreters are:
-
CPython
The interpreter implemented in C language, the most commonly used interpreter, usually refers to the interpreter
-
Jython
Using the interpreter implemented in Java language, Jython can directly call the java class library, suitable for development on the java platform
-
IronPython
The interpreter used on the .NET platform can directly call the classes of the .NET platform, suitable for development on the .NET platform
-
PyPy
Interpreter implemented in Python language
Search [Zixin] on WeChat or scan the QR code below to make friends and make progress together. The article is continuously updated. At present, I am organizing the study notes of Python hundred battles, and I look forward to more updates in the future.