目錄python
# lib/aa.py class C: def __init__(self): self.name = 'SB'
# index.py from lib.aa import C obj = C()
print(obj.__module__) # 輸出 lib.aa,即:輸出模塊
print(obj.__class__) # 輸出 lib.aa.C,即:輸出類