wxpython从widget中读取数据

Reading data from the widget in wxpython

我想知道单击附图中的确定按钮后如何从TextCtrl框中读取起始地址和结束地址的数据。

您需要调用每个文本控件的 GetValue() 方法。 'GetValue()` returns 文本控件中的任何内容。

所以假设起始地址文本控件被称为self.start_address。在你按钮的处理程序中,你会做这样的事情:

def on_ok(self, event):
    start_address = self.start_address.GetValue()