您的问题发生在此行上:
self.text= tk.Text(self).grid()
grid没有明确显示
return任何内容,因此这是有效设置
self.text =None。然后将此值传递给,
Output.__init__并最终在中访问
write。
而是将其分为两个步骤:
self.text = tk.Text(self) self.text.grid()

您的问题发生在此行上:
self.text= tk.Text(self).grid()
grid没有明确显示
return任何内容,因此这是有效设置
self.text =None。然后将此值传递给,
Output.__init__并最终在中访问
write。
而是将其分为两个步骤:
self.text = tk.Text(self) self.text.grid()