Well, i want to receive some bytes from a client to a server in python. So I send some strings from client: OLA, 135 and A.
The code lines of server is:
while True:
# Receive the data one byte at a time
data = connection.recv(1)
file = open("test.txt", "w")
file.write(data)
file.close()
sys.stdout.write(data)
I want to write these strings sended by client in a txt file. But after I received all strings in the server I open the txt file created and there are nothing. What is wrong?