Python Module (module)
In the process of computer development, as the program code more write more, in a file, the code will be longer and more difficult to maintain.
In order to write maintainable code, we grouped a number of functions into separate files so that each file contained less code, and many programming languages used this type of organization code. In Python, a. py file is called a module.
What is the advantage of using a module?
The biggest benefit is a significant increase in the maintainability of the code. Second, the code you write does not have to start from scratch. When a module is written, it can be referenced elsewhere. When we write a program, we often refer to other modules, including Python's built-in modules and modules from third parties.
You can also avoid conflicting function names and variable names by using modules. Functions and variables of the same name can be found in separate modules.
Python built-in functions:
|
built-in Functions |
|
|
| ABS () |
Divmod () |
Input () |
Open () |
Staticmethod () |
| All () |
Enumerate () |
Int () |
Ord () |
STR () |
| Any () |
Eval () |
Isinstance () |
POW () |
SUM () |
| Basestring () |
ExecFile () |
Issubclass () |
Print () |
Super () |
| Bin () |
File () |
ITER () |
Property () |
Tuple () |
| BOOL () |
Filter () |
Len () |
Range () |
Type () |
| ByteArray () |
Float () |
List () |
Raw_input () |
UNICHR () |
| Callable () |
Format () |
Locals () |
Reduce () |
Unicode () |
| Chr () |
Frozenset () |
Long () |
Reload () |
VARs () |
| Classmethod () |
GetAttr () |
Map () |
Repr () |
Xrange () |
| CMP () |
Globals () |
Max () |
Reversed () |
Zip () |
| Compile () |
Hasattr () |
Memoryview () |
Round () |
__import__ () |
| Complex () |
Hash () |
Min () |
Set () |
|
| Delattr () |
Help () |