import wx class MainFrame(wx.Frame): def __init__(self, parent): super(MainFrame, self).__init__(parent) self.button1 = wx.Button(self, label='vmi') self.button1.SetPosition((50, 50)) self.Bind(wx.EVT_BUTTON, self.onClickGomb1, self.button1) self.entry = wx.TextCtrl(self) self.entry.SetPosition((50, 100)) def onClickGomb1(self, event): numStr = self.entry.GetValue() product = int(numStr) * 2 self.entry.SetValue(str(product)) class App(wx.App): def OnInit(self): frame = MainFrame(None) frame.Show() return True app = App() app.MainLoop()