Python Second Module learning summary, python module Summary
Summary:
1. Master the usage of the decorator
2. master generator usage
3. Understand the usage of the iterator
4. Familiar with Python built-in functions
5. Familiar with Python shutil/shelve/configparse/hashlib/logging Module
Details:
Decorator:
1. the decorator concept: decorate other functions by adding additional functions to other functions. usage principles: 1. the source code of the decorated function cannot be modified. 2. the call method of the called function cannot be modified. 3. high-order functions 4. generator: Only corresponding data is generated during the call, and only the current location is recorded. Only one _ next () _ Method 5 is generated. iterator: It is highly efficient to use the iterator. 6. about the use of the logging module: in the project, we use the name config. the Python module of py is used to save global configurations. Because logging may be used in every source code file in the project, we use the logging module in config. generate an instance in py, so that other modules only need to reference this instance. 7. the shutil module is used to save files. the shelve module is a simple k. v uses the memory data through the file persistence module to persist any python data formats supported by pickle 9. problems encountered in ATM operations: 1. there is a problem with the module calling in different path files because the file name contains special characters 2. the decorator application scenario is not very clear 10. problems in the calculator job: 1. the loop should be outside def call. If it is within the function, the input and output must be synchronized. after parentheses are removed, the Operation Sequence needs to be adjusted and regular expressions are required for exact matching.