标签:私有 mod style 导入 idt width 引入 code pre
#t.py模块下 def test1(): print("我在这里等你") def _test2(): print("我是私有属性哦") ############# #执行函数 module_t = __import__("m1.t") #这样调用得到的是最顶层的m1模块 module_t.t.test1()
from m1.t import test1,_test2 _test2()
import importlib m = importlib.import_module("m1.t") #直接拿到t模块 m.test1() m._test2()
标签:私有 mod style 导入 idt width 引入 code pre
原文地址:https://www.cnblogs.com/dabai123/p/11595251.html