Module
In the development of computer programs, as the program code more and more, in a file code will be more and more long, more and more difficult to maintain.
In order to write maintainable code, we grouped many functions into separate files so that each file contained relatively few code, and many programming languages used this kind of organization code, in Python, a. py file is called a module.
Benefits of using modules
The greatest benefit of using the module first is that it greatly improves the maintainability of the code.
Second, writing code does not have to start from scratch. When a module is written, it can be referenced elsewhere. When we write programs, we often refer to other modules, including Python built-in modules and modules from third parties.
Therefore, the module is divided into three kinds:
-python Standard Library
-third-party modules
-Application Custom Module
In addition, the use of modules can also avoid conflicting function names and variable names. Functions and variables of the same name can exist in different modules individually, so we do not have to think about names that conflict with other modules when we write our own modules. But also be aware that try not to conflict with the built-in function name.
Modules in Python, common modules--12