# from tall import b from tall import * print(b) __all__ 模块 引用管理
├── __init__.py
├── tall2.py
└── tall.py
tall.py
a = 23
b = 34
class I:
def __init__(self):
print(444)
class J:
pass
__all__ = [
'a', 'I',
]
tall2.py
# from tall import b #可以获取b
# print(b)
from tall import * #不可以获取b
print(b)