singletion模块
class Test(): pass a = Test()
调用模块
from singleton.test import a if __name__ == "__main__": for item in range(10): b = a print(id(b))
标签:__,单例,创建,模式,模块,Test From: https://www.cnblogs.com/fuchenjie/p/17507987.html
singletion模块
class Test(): pass a = Test()
调用模块
from singleton.test import a if __name__ == "__main__": for item in range(10): b = a print(id(b))
标签:__,单例,创建,模式,模块,Test From: https://www.cnblogs.com/fuchenjie/p/17507987.html