im using "popen" in a server script to to store a ping output in a file and also send the it to the client.
this is the code in the server.py file: