BlackFlame33

BlackFlame33

若无力驾驭,自由便是负担。个人博客 https://blackflame33.cn/

Python Study Notes-01

title: Python Study Notes-01
date: 2019-09-27 14:15:38.0
updated: 2022-01-20 20:49:21.425
url: /archives/python-notes-01
categories:

  • Study Notes
    tags:
  • Python

History and Features of the Python Programming Language

1. Introduction to Python#

Python is an object-oriented, interpreted computer programming language. Python syntax is concise and clear, and it uses text indentation to represent code blocks instead of using braces like most other languages. This enforced indentation forces programmers to pay constant attention to code formatting, resulting in clear and elegant code structure.

# Print Hello World
print("Hello, world!") # Yes, just one line, only one line is needed

2. Features of Python#

2.1 Glue Language#

Python can easily connect various modules made in other languages. For example, you can quickly develop a program using Python and then rewrite specific parts in a more suitable language.

2.2 High-level Language#

Python is a "high-level" programming language. This high-level does not refer to performance or superiority, but rather to its semantic closeness to human language, making it easier to understand.

2.3 Rapid Development with Frameworks#

Python has numerous frameworks available for developing large-scale applications. For example, web development with Django.

2.4 Limitations#

Due to its interpretation (even if it is compiled, it is "just-in-time compilation"), Python is compiled into bytecode, which may result in slightly poorer performance compared to other languages.

3. Cornerstone Concepts#

3.1 Programming Language#

Humans cannot solve problems quickly and efficiently, but computers can. However, humans and computers cannot understand each other. For example, different species cannot communicate directly due to the lack of a common language. To solve this problem, one party needs to compromise and accommodate the other. Early programming was a time when programmers accommodated computers, but machine language was too cumbersome and too close to the low-level, causing great pain for programmers. To alleviate this situation, programmers came up with the idea of "abstracting" the meaning represented by machine language, making it closer to human language, and thus computer programming languages were born.

Evolutionary process - Machine Language -> Assembly Language (Low-level language) -> Programming Language (High-level language)

3.2 Compiler#

A program that translates assembly or high-level computer language source code into equivalent machine code in the target language.

3.3 Interpreter#

An interpreter can directly translate and execute high-level programming languages line by line. The interpreter does not translate the entire program at once but acts like an "intermediary", translating into another language each time the program is run. Therefore, the interpreter's program execution speed is relatively slow.

Difference between compiler and interpreter: Translation and simultaneous interpretation - Translation is the complete translation of pre-prepared information into the target language. Simultaneous interpretation is the translation of each sentence into the target language.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.