Python Init Modules

__init__.py 文件的作用是将文件夹变为一个Python模块,Python 中的每个模块的包中,都有__init__.py 文件。


1
__all__=[]

The __all__ is a special variable, which defines what attribute, functions or modules can be imported into other modules.

Reference

  1. Python __init__.py 作用详解
  2. Python模块导入时全局变量”__all__“的作用 https://blog.csdn.net/chuan_day/article/details/79694319