[翻译] python Tutorial 之三
def __init__(self,controls): (1) self.expression= "" (2)(3)
for i in controls: (4)
if isinstance(i, Button): (5)
if hasattr(self, "on_" + i.Name): (6)
i.Click += getattr(self, "on_" + i.Name) (7)
elif isinstance(i, TextBox): (8)
if i.Name == "Result": (9)
self.result = i (10)
页:
[1]