Advertisement
Guest User

Untitled

a guest
May 20th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. import socket
  2. import struct
  3.  
  4. udp_port = 7830
  5. sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
  6. sock.connect(('localhost', udp_port))
  7. string = "#"
  8. udp_data = bytearray()
  9. udp_data.extend(string.encode())
  10. udp_data.append(8)
  11. udp_data.append(0)
  12. sock.send(udp_data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement