Today it was important to find the basics, so I went back to the basics and decided to clean up my blog. Here we go!

I met a python

Computer hardware

First is the computer hardware, after all, is the development of supporting software and hardware, the so simple, computer hardware consists of CPU, memory, and hard disk, CPU is mainly responsible for operations, memory is mainly responsible for temporary data storage, it has the advantage of storage and reading speed, but the downside is also very obvious, is particularly expensive! The difference between the size of memory and the size of the hard disk in our computers is obvious, and the hard disk is used to store data permanently, which is relatively slow compared to the memory.

Introduction to Python

First of all, it’s important to know that Python is the creator of python. Python has a very different style from other programming languages. Python values elegance, clarity, and simplicity, and this is true when you get into Python. Python has now been updated to version 3.x, which is a big improvement over previous versions. For example, in Python 2.x, the source code is confusing, and there is a lot of duplicate code and redundancy. In Python3. x, the source code specification advocates elegance, clarity, and simplicity, which is the style of the Python language since version 3.

And python is an interpreted language. What is an interpreted language? Programming languages are divided into interpreted and compiled. The latter literally means that the code is compiled into machine code and then executed. The latter is precisely defined as that the code is compiled into machine code and then run. The following is a detailed introduction:

Compiled: compiles all the code into machine code at one time, and then runs the representative language: C language, C ++ Advantages: high execution efficiency Disadvantages: slow error troubleshooting, low development efficiency, cannot cross platformCopy the code

Explanatory type: when the program is running, the code is interpreted into machine code line by line, and then the representative language is run: Python Advantage: fast error troubleshooting, high development efficiency, cross-platform disadvantage: low execution efficiencyCopy the code

Python language Classification

The Python language can be divided into the following categories:

The main difference is that —— Python is written with the same rules, but the interpreter is designed for a different platform. We usually use CPython because we are closer to the underlying code.

  • Cpython

The official version of Python, implemented in C, is the most widely used. CPython implementations convert source files (py files) into bytecode files (PYC files), which are then run on the Python virtual machine.

  • Jyhton

A Java implementation of Python, Jython dynamically compiles Python code into Java bytecode and then runs it on the JVM.

  • IronPython

A C# implementation of Python, IronPython compiles Python code into C# bytecode and then runs it on the CLR. (Similar to Jython)

  • PyPy (special)

Python implementation of Python, which recompiles Python’s bytecode bytecode into machine code.

  • RubyPython、Brython ...

   

Pypython is fast, as long as the execution speed is increased by further processing of Python bytecode on the basis of Python.