# coding: utf-8 import socket hote = "localhost" port = 15555 socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) socket.connect((hote, port)) print ("Connection on "+str(port)) socket.send("Hey my name is Bertrand!".encode('utf-8')) print("Close") socket.close()