import socket

myserver = socket.socket()
hostname = socket.gethostname()
port = 33221
myserver.bind((hostname, port))
myserver.listen()

(connection, addr) = myserver.accept()

while True:
    msg_from_client = connection.recv(1024).decode('utf-8')
    in_capital_letters = msg_from_client.upper()
    connection.send(in_capital_letters.encode('utf-8'))