相关疑难解决方法(0)

如何防止模块导入两次?

在编写python模块时,有没有办法防止它被客户端代码导入两次?就像c/c ++头文件一样:

#ifndef XXX
#define XXX
...
#endif
Run Code Online (Sandbox Code Playgroud)

非常感谢!

python import module

29
推荐指数
3
解决办法
2万
查看次数

标签 统计

import ×1

module ×1

python ×1