Python - from XXX import *

【Python多態與動態綁定】python Main.pyspa from Source import * #導入了Source中定義的class部分 #導入的是邏輯+數據 x = B() print(x.show()) #繼承的是邏輯 class B(A): def __init__(self): print("===") self.data = 99
相關文章
相關標籤/搜索