Module:
A module is a file containing Python definitions and statements.
As the doc say.
So a module in python is simply a way to organize the code, and it contains either python classes or just functions.
If you need those classes or functions in your project, you just import
them.
For instance, the math
module in python contains just a bunch of functions, and you just call those needed (math.sin
).
Just have a look at this question.
On the other hand a python class is something similar to a java class, it's only structured in a slightly different way.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…