I am writing a small chat app with python using bash commands. I'm using nc to accomplish this but I want to be able to append a username before the user's message. How do I go about doing this without breaking the connection?
The command I'm using to connect is just 
nc -l -p 1234 -q 0
and the desired outcome is that when the person sends something it would look like: <User1> Hello
Thank you!
its hard to understand the context and the applications structure, but i would assume that putting the connection in a separate thread would help. So that the connection is always open and the messages can be processed in preferred fashion.
How to print text while netcat is listening at a port?