[Python study notes] 1. Introduction to Python

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

  1. 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.

  2. 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

Insert picture description here

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)
  1. Object-oriented

  2. Free and open source

  3. 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

  4. Rich library

    Rich standard library, various extension libraries

  5. Scalability

    Can be embedded in C and C++ languages, glue language

Scope of application

  1. Scientific Computing

  2. artificial intelligence

  3. WEB server and large website backend

    YouTunbe gmail and other applications are developed based on python

  4. GUI development (graphic user interface development)

  5. game development

  6. Mobile devices

  7. Embedded device

  8. System operation and maintenance

  9. Big Data

  10. cloud computing

When should you not use python

  1. 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

  1. 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
  2. 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:

  1. CPython

    The interpreter implemented in C language, the most commonly used interpreter, usually refers to the interpreter

  2. Jython

    Using the interpreter implemented in Java language, Jython can directly call the java class library, suitable for development on the java platform

  3. IronPython

    The interpreter used on the .NET platform can directly call the classes of the .NET platform, suitable for development on the .NET platform

  4. 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.
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_51656605/article/details/111696572