# to run this program type: # python UDPClient.py from socket import * #serverName = 'localhost' # You have to put here the name of the host where the server is running serverName = 'aragorn.elo.utfsm.cl' # You have to put here the name of the host where the server is running serverPort = 47204 clientSocket = socket(AF_INET,SOCK_DGRAM) # to see the Socket API, go to https://docs.python.org/3/library/socket.html # In this case, AF_INET is used for IPv4 y SOCK_DGRAM for UDP. message = input('Input lowercase sentence: ') clientSocket.sendto(message.encode(),(serverName, serverPort)) modifiedMessage, serverAddress = clientSocket.recvfrom(2048) print (modifiedMessage.decode()) clientSocket.close()