import socket


def main():
    # destination IP/port (to be replaced)
    UDP_IP = "1.1.1.1"
    UDP_PORT = 1234
    UDP_ADDR = (UDP_IP, UDP_PORT)

    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    print("Sending to {}:{}".format(UDP_IP, UDP_PORT))

    while True:
        data_str = input("data: ")
        if data_str == "":
            break
        data = bytes(data_str, encoding="utf-8")
        sock.sendto(data, UDP_ADDR)


if __name__ == "__main__":
    main()
