import 导入模块,在调用模块时需要用全限定名。例如:
import model_1;model_1中有个方法为method1
那么在调用method1就不需要model_1.method1()
from ... import ...导入模块,在调用模块时不需要使用全限定名。直接用方法名就行。
import 导入模块,在调用模块时需要用全限定名。例如:
import model_1;model_1中有个方法为method1
那么在调用method1就不需要model_1.method1()
from ... import ...导入模块,在调用模块时不需要使用全限定名。直接用方法名就行。
转载于:https://www.cnblogs.com/hf-china/p/5105314.html