background
There are some basic nouns in python, and many people, especially beginners, may sound dizzy.
Here, a brief summary of the approximate differences between module,library,package.
in PythonIntroduction to Module
module, Chinese translation: modules
The module in Python, plainly, is a Python file, and the Python file is generally suffixed with PY, so it's your xxx.py.
about the library
Library, Chinese translation: libraries, also commonly known as: library files
The reason why this is not said to be python in the library, it is because, its own library this word, is generally aimed at other compiled language, such as c,c# language.
A library in a common language, such as c/c#, is generally referred to as:
Static library file: Xxx.a
Dynamic Library Files: Xxx.dll
Introduction to the package in Python
Package, Chinese translation: Pack
The package in Python can be easily understood as a group of module, a bunch of (related) module combinations;
the difference between module and library in Python
For the library and module, plainly, all provide a certain function for others to call.
In this regard, it can also be understood as:
The library in Python is equivalent to module;
Only, Python, rarely say the library, normal words, are said module;
So, in short:
- Most of the library refers to c,c# and other languages in the libraries, library files;
- In Python, the term library is seldom used;
- Python in the "library", "library file" name, called module, modules;
- Whether you are a beginner in Python or a master, personal advice is still used, official, generic, use the word module, instead of using the word Library;
the difference between the module and the package in Python
Import a single module, which is usually the case
Import My_module
Importing a package is generally the case:
from Import Function_of_love
Can be simply understood as:
- Module: Individual modules, typically single (occasionally multiple) python files;
- Package: A combination of multiple related module. Must be a combination of multiple, related, python files; the package is used to organize the relevant modules together to become a whole;
The difference between the object-oriented module,library,package of getting started with Python