Principle python program execution

We must first understand the CPU, memory, hard disk .

CPU: Central Processing Unit, is a large-scale integrated circuits. Responsible for data processing / computing.

Memory: temporary storage of data (after a power outage, the data will disappear). Fast, small space.

Hard disk: permanently store data, slow, big space.

The principle of program execution:

1. Before the program is not executed, stored in a hard disk;

2. When you want to run a program:

  • First, let cpu operating system to copy the program into memory;
  • Cpu then executing the program code in memory;

In short, the program to be executed, it must first be loaded into memory.

Principle python program execution:

python is an interpreted language, not a compiled language. Features interpreted language is the need for an interpreter interpreted code line by line, there is no compilation stage. Compile means to convert the code into computer recognizable binary files, which are then linked into the binary executable.

(1) First, let cpu operating system to copy the python interpreter into memory;

(2) python interpreter syntax rules: Let cpu from the translated code python program down;

(3) cpu responsible for executing the code translation completed;

Python interpreter what?

cpython: Based on the c language;

jython: jav-based language;

pypy: python-based language;

Guess you like

Origin www.cnblogs.com/xiximayou/p/12132089.html