I created a Client/Server code in python. Server works well and get listen on 8000 port, but when I connect to it via client and then I try to send a message to server I get the
The python 2 documentation for the sockets class shows the .send function/method accepting a string parameter - but if you look at the python 3 documentation for the same class you'll see that .send now requires the data to be passed as a parameter of type bytearray.
Changing:
sendData = str(input("Client : "))
to
sendData = str.encode(input("Client : "))
should do the trick, I believe.
TcpSocket.send(sendData)
Looks like send accepts only bytes
instances. Try:
TcpSocket.send(bytes(sendData, "ascii")) #... or whatever encoding is appropriate