Python3 Fifth Zhou (module, Introduction method, Import essence, import optimization, module classification)

Source: Internet
Author: User

1. Definition:

Modules: Logically organizing python code (variables, functions, classes, logic: Implementing a function, which is essentially the. py end of the file)

2. How to Import

Import Module_name,module_name2,......

From module import Module1,module2,....

From module import logger as xxx: equals an alias for the imported module

The From module import * may have the same name as the existing module under the current path

3.import Nature (Path search and search path)

The essence of the import package: Execute the __init__.py file under the package,

Import package differs from Import module: Import package, the following module call executes directly

4. Import optimization

From module file import method, can avoid repeatedly to find this file, can greatly save time

5. Classification of modules

A standard library:

B Open Source module:

C Custom Modules:

Python3 Fifth Zhou (module, Introduction method, Import essence, import optimization, module classification)

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.