我沒有得到我的代碼的任何錯誤,但是當我點擊垃圾郵件按鈕後,它凍結,沒有任何反應。有沒有人看到代碼有什麼問題?wxPython應用程序:沒有錯誤,但仍然凍結
import Skype4Py, wx, time as t
skype = Skype4Py.Skype()
skype.Attach()
name = ""
chat = ""
message = ""
class skyped(wx.Frame):
def __init__(self,parent,id):
wx.Frame.__init__(self,parent,id,"Skype Chat Spammer",size=(300,200))
panel=wx.Panel(self)
start=wx.Button(panel,label="Spam!",pos=(140,100),size=(50,20))
stop=wx.Button(panel,label="Stop!", pos=(200,100),size=(50,20))
self.Bind(wx.EVT_BUTTON, self.spam, start)
self.Bind(wx.EVT_CLOSE, self.closewindow)
entered=wx.TextEntryDialog(None, "User to spam?", "User", "Username Here")
if entered.ShowModal()==wx.ID_OK:
name=entered.GetValue()
entered1=wx.TextEntryDialog(None, "Message?", "Message", "Message Here")
if entered1.ShowModal()==wx.ID_OK:
message=entered1.GetValue()
def spam(self,event):
global chat
global name
global message
chat = skype.CreateChatWith(name)
while 1:
chat.SendMessage(message)
def closewindow(self,event):
self.Destroy()
if __name__=="__main__":
app=wx.PySimpleApp()
frame=skyped(parent=None,id=-1)
frame.Show()
app.MainLoop()
謝謝你這就是我一直在尋找的。 – user1152873