import

模块本质就是从逻辑上组织PYTHON代码(变量,函数,类)实现功能一个.py的文件

包本质就是包含了__init__.py的文件的目录 其作用是组织模块文件

import模块的本质就是将模块test.py文件解释执行一下

import包的本质就是解释执行一下__init__.py文件

import test ,test1

from test import *

from test import bin,fun (变量或函数)

from test import fun as fun1

导入到模块的上层目录(包)sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

posted @ 2017-04-03 18:28  howhy  阅读(179)  评论(0)    收藏  举报