def sendMsg(self, event): msg = self.chatPanel.sendBox.GetValue() self.chatPanel.sendBox.SetValue("") print("我说:{0}".format(msg)) if Chat.chatWith == None: wx.MessageBox("请选择一位好友!", "提示", wx.OK, self) return Chat.send(msg) date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())) self.SetWord(Chat.chatWith.count, date, msg, "我说")