At the beginning of the Python stage, most of the calls to functions, classes, modules, and packages are not very clear, and this essay simply explains them.
? (1) function
When the function is well defined, it can be called directly.
For example:def summ (ADD1,ADD2), then can be called directly, namely:Summ ()
(2) class
After a class is defined, it cannot be called directly as a function, but requires an indirect call.
For example:class people, then call,a=people ( object ), after,a.age () wait
(3) module
placing multiple classes under the same PY , such as in model.py , the import model can be called
(4) package
- Create a folder under the Site-package folder, such as : Kitchen
- other classes of . PYare put in the Kitchen file
- in which the __init__.py file is created, an import statement is displayed, such as the file name of the From Omelet (Party omelet Class) omelet.py) Import omelet ( class name ). when programming, direct import Kitchen,kitchen.xxx can be called
Calls to functions, classes, modules, and packages in Python