當前位置:編程學習大全網 - 電腦編程 - 用wxpython編寫界面用button調用另壹個類中的事件,如何編程?

用wxpython編寫界面用button調用另壹個類中的事件,如何編程?

不知道理解的對不對。妳看這樣行麽。

class Test(unittest.TestCase):

......

無縮進t = Test(‘test1’,'test2')

class InsertFrame(wx.Frame):

......

self.Bind(wx.EVT_BUTTON, self.OnTest, button2)

......

def OnTest(self, event):

test = Test()

test.setToken("****", "****")

self.screen_name = label.screen_name.GetValue()

直接用實例化後的t.user_timeline

t.user_timeline(self.screen_name)

for i in range[0:200]:

self.tc.AppendText(test.temp[i])

  • 上一篇:星星和月月壹起跳繩星星兩次***跳了92下月月第壹次跳了五十下第二次月月至少跳
  • 下一篇:傳奇版本將max引擎轉換成HERO引擎
  • copyright 2024編程學習大全網