I'm writing a simple network interact console, like netcat.
I don't understand how to let a loop do sock.recv and send data read from socket to the Text body of the UI while the UI is responsive, the menu has a send_handler that executes a query and then send that data through the socket.

please help me!