def workerThread1(self): """ This is where we handle the asynchronous I/O. For example, it may be a 'select()'. One important thing to remember is that the thread has to yield control. """ ChatClient.connect() while self.running: message = ChatClient.listener() if message is not None and len(message) > 1: self.queue.put(message)
def start(): global client client = ChatClient() global login_frame login_frame = LoginPanel(login, register, close_login_window) login_frame.show()
def send(message, instance): msg = "[Me]: " + message + "\n" ChatClient.send_message(message + "\n") instance.text_input.delete(0, END) instance.queue.put(msg)
def exit_chat(): ChatClient.exit() client.endApplication() sys.exit()