Python学习之Python中import与from .. import ...的区别

import 导入模块,在调用模块时需要用全限定名。例如:

  import model_1;model_1中有个方法为method1

  那么在调用method1就不需要model_1.method1()

from ... import ...导入模块,在调用模块时不需要使用全限定名。直接用方法名就行。

posted @ 2016-01-06 13:48  Program_青菜  阅读(234)  评论(0)    收藏  举报