OK! So I have a program that will connect to a server through telnet and open a little GUI thing to input text. I want all the incoming stuff from the server to be printed to the terminal window while everything from the little GUI box goes to the server.
The box to server works just fine, the problem is that I don't know how to have a loop that gets the data from the server while running the GUI box. If anyone can help out that would be fantastic. here is the code I am struggling with:
I'm not familiar with python but here are the two possible approaches:
- use non-blocking i/o (a function call to read/write immediately returns instead of waiting untill the work has been done)
- use threads (one to paint to gui, one to handle the io)