2. Class decorators are a bit like aspect programming
3. Database connection pool
4. Multithreading
difference
1. Create a new file without class
If a language does not support inheritance, classes are meaningless.
self refers to the class instance, not the class; class methods have only one special difference from ordinary functions - they must have an additional first parameter name, which by convention is self.
It can be clearly seen from the execution results that self represents the instance of the class, represents the address of the current object, and self.class points to the class.
self is not a Python keyword, we can replace it with runoob and it can still be executed normally:
2. Multiple inheritance
2. Many algorithms are more convenient to operate
###1. The math module provides access to the underlying C function library for floating-point operations:
1. There are derivations for calculation
3. No need to modify variables, just use
4.import can import the specified function and the module under the path
5. File permission modification
6. Cleanup Statements
7. Placeholder pass
ifTrue:pass# 这里暂时不做任何操作 for i inrange(5):pass# 循环体为空,但仍然会执行5次
1
2
3
4
5
The pass statement is mainly used as a placeholder, indicating that there should be a statement at that position, but it has not been implemented yet. Overuse of pass can make your code less readable, because it simply says "there should be code here, but there isn't yet." Therefore, when writing code, you should try to avoid unnecessary pass statements. pass can be used alone or as part of a function body, class body, loop body, conditional body, etc. pass is a built-in statement in Python and can be used without importing any modules.
8.pycharm cannot install tomcat, but can be used
9. Front-end framework
The association of Python with the front-end (such as HTML, CSS, JavaScript) is usually achieved through web frameworks, which allow Python code to run on the server and interact with the front-end. Here are some basic steps and commonly used frameworks to show how to associate Python with the front-end:
Flask: A lightweight web framework that is easy to learn and use, suitable for small projects and rapid prototyping.
Django: A powerful web framework that provides rich built-in functionality and extensibility for large and complex applications.
FastAPI: A modern, fast (and high-performance) web framework for building APIs, supporting asynchronous operations and type hinting for Python 3.6+.