Python Learning Path 01

Source: Internet
Author: User
Tags virtual environment virtualenv

1. Briefly describe the compilation process of the Python programming language.

When the Python code is executed, the four processes "disassemble" Our code in the Python interpreter and are eventually returned to the user by the CPU execution. First, when the user type code to the Python processing will be the first lexical analysis, such as the code in the keyword or when the input keyword is wrong, will be triggered by lexical analysis, the incorrect code will not be executed. Next Python will parse the syntax and the error code will not be executed. Following the most critical process, Python generates the. pyc file, which is the byte code, before Python is executed. The byte Code python virtual machine program corresponds to the Pycodeobject object. The. pyc file is a representation of the bytecode on disk. Simply put, in the process of compiling the code, the functions, classes and other objects in the code are processed first, and then the bytecode file is generated. With the bytecode file, the CPU can directly identify the bytecode file for processing, and then Python can execute it.

The difference between 2.py, PYC, Pyo, and PYD.

PY is the suffix of all Python scripts and runs the *.py file directly through the interpreter
PYC is a binary file, which is compiled by the Py file after the interpreter, generated on disk in the form of a file, is a byte code,py file into a pyc file, the speed of loading increased, and PYC is a cross-platform bytecode, is executed by the Python interpreter. The content of PYC is related to the Python version, and the PYC files are different after the versions are compiled.
PYO is an optimized compiled program that python-o-m source files can compile the source program into a pyo file
PYD is a python dynamic-link library file that is generated by the other programming language "write-compile" the Python extension module.

3.Python in the field of data acquisition, scientific computing, artificial intelligence and web development of the common module name.

Data acquisition domain Requests module Library, Urllib module library, re module library, etc.
The field of mathematical analysis and scientific calculation NumPy module library, scipy Module library, pandas module library, etc.
AI domain scikit-learn module library, Keras module library, etc.
Web development domain Secket Module library, Django Module library, etc.

4. What is Virtualenv? What is the role of it?

Virtualenv is a virtual environment that is intended to allow multiple versions of Python to coexist.

What are the 5.python development ides? A brief description of each type of compiler.

1. The default Idel is the integrated development environment of the Python package, which makes it easy to create, run, and debug Python programs.
2.VSCode is Microsoft's official launch of the powerful language compiler, is widely used by Python developers.
3.Sublime TEXT3 is a code compiler with a beautiful user interface and powerful features.
4.PyCharm is a Python IDE with a complete set of tools to help users improve their efficiency when developing with the Python language.
5.PyDev is an important plug-in for the eclipse for Python that makes eclipse a professional Python IDE.

6. How do I understand pycodeobject and Pyframeobject objects?

The PYC bytecode corresponds to the Pycodeobject object in the Python virtual machine, and the virtual machine first encapsulates the bytecode into a Pycodeobject object and then executes the bytecode instruction.
When a function call occurs, a new stack frame is created, and the corresponding Python implementation is the Pyframeobject object

Python Learning Path 01

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.