[Learn Python with me] Explain the execution principle in Python and explain the execution principle in python.

Source: Internet
Author: User

[Learn Python with me] Explain the execution principle in Python and explain the execution principle in python.

The explain Execution here is relative to the compilation execution. We all know that a program written in C/C ++ or another compilation language needs to be converted from the source file to the machine language used by the computer, A binary executable file is formed after the link of the linker. When running this program, you can load the binary program from the hard disk to the memory and run it.

But for Python, The python source code does not need to be compiled into binary code. It can run programs directly from the source code. When we run the python file program,Python InterpreterConvert source code to bytecode, and thenPython InterpreterTo execute these bytecode. In this way, python does not have to worry about program compilation, Library Link loading, and other issues.

Python has the following three features:

To implement a language on a specific computer, you must first determine the virtual computer that represents the semantic interpretation of the language. A key problem is that the basic expression during program execution isThe machine language on the actual computer is also the machine language of the Virtual Machine. This problem determines the implementation of the language. According to the answer to this question, the programming language can be divided into two categories:Compiled and interpreted languages.

Explain the execution process of this Python Function

It is indeed recursive. When executing the command, one yield is passed to another yield, which seems inefficient.
This is similar to the example given at the end of this article:

In other words, listing = [I for I in fun] seems to be a List = List (fun)

I started to learn python cainiao, and asked python to execute print 'hello, world'. For details, refer to "invalid syntax ".

You use python 3.2, and the statement you entered is python 2. Of course, it is incorrect.
Which version of the software do you use.

For beginners, python2 and python3 have slightly different details, with little impact. However, we recommend that you use python2 for actual projects, because python often uses third-party libraries written by others. Currently, most third-party libraries are still in the python2 version, python 3 may be incompatible.
As for how many differences exist between python2 and python3, you can buy a Python Reference Manual (version 4th). the last part of this book is described in detail.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.