python3包、模块、类、方法的认识

包>>模块>>类>> 函数


包:就是一个目录,import time from+import导入包中的部分模块

 直接到类

from budaoguan.common.timeUtil import TimeUtil

直接到模块
from budaoguan.common import timeUtil

模块:在python可以理解为一个文件(以.py结尾的文件)

类:数据与操作进行了封装,为的是将来可以复用

class关键字开头

函数:def关键字开头的

原文地址:https://www.cnblogs.com/liunaixu/p/11180000.html