Python: TypeError: str, bytes or bytearray expected, not int
问题 I'm trying to create a simple server to client based chat program and the issue is that when I try to execute c.sendto(data,client) this error appears saying that Client is an int but it's a tuple containing the port number and the address. I'm I supposed to convert the tuple to bytes so I can send the message to the clients? Server Script import socket clients = [] s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("127.0.0.1",7999)) s.listen() print("Waiting for connection") c,