andy27367451 发表于 2018-8-9 13:39:00

[翻译] 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]
查看完整版本: [翻译] python Tutorial 之三