Created
November 12, 2018 12:14
-
-
Save yychen/bde3d6ba43b622274e739decc436759c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import socket | |
UDP_IP = "127.0.0.1" | |
UDP_PORT = 3838 | |
# MESSAGE = "\nter 0.78\nmaster 0.4\nmaster 0.5" | |
MESSAGE = "This is a test....\n\n" | |
print("UDP target IP:", UDP_IP) | |
print("UDP target port:", UDP_PORT) | |
print("message:", MESSAGE) | |
sock = socket.socket(socket.AF_INET, # Internet | |
socket.SOCK_DGRAM) # UDP | |
sock.sendto(bytes(MESSAGE, 'utf-8'), (UDP_IP, UDP_PORT)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment