import socket clisocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) while 1: data = "data" if data: clisocket.sendto(data, ("lessaworld.com", 8000)) else: break s.close()