The difference between Python classes, modules, and packages

As a python beginner, I often encounter some conceptual understanding problems in calling;

Let me first explain that a python project will contain various directory files. I summarize their concepts of each other as:

(1) The package contains various modules, the modules contain various classes, and the classes contain the function names and variables we wrote;

(2) Package > Module > Class;

E.g:

1)from a import b;

It can be understood that the function b is imported from the template a. But if a template has __init__.py in it, it will import it first.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324491531&siteId=291194637