I want to make a python script which connects to a server to start getting data and interacts with user in the same time ala chat. I want it to run in a terminal/console. After I connect a socket, how to ensure that it is writing text from the server if there is any waiting for possible user input in the same time? Thanks