#This program illustrates the client-server model using multithreading. #Multiole clients can connect to server and each time a client connects a corresponding #thread is created for handling client requests import socket ClientSocket = socket.socket() host = '127.0.0.1' port = 1233 print('Waiting for connection') try: ClientSocket.connect((host, port)) except socket.error as e: print(str(e)) Response = ClientSocket.recv(1024) while True: Input = input('Say Something: ') ClientSocket.send(str.encode(Input)) Response = ClientSocket.recv(1024) print(Response.decode('utf-8')) ClientSocket.close()