Python Second Module learning summary, python module Summary

Source: Internet
Author: User

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.

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.