Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python class udp

1 import socket
   2 
   3 UDP_IP = "127.0.0.1"
   4 UDP_PORT = 5005
   5 MESSAGE = b"Hello, World!"
   6 
   7 print("UDP target IP: %s" % UDP_IP)
   8 print("UDP target port: %s" % UDP_PORT)
   9 print("message: %s" % MESSAGE)
  10 
  11 sock = socket.socket(socket.AF_INET, # Internet
  12                      socket.SOCK_DGRAM) # UDP
  13 sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
Comment

python class udp

1 import socket
   2 
   3 UDP_IP = "127.0.0.1"
   4 UDP_PORT = 5005
   5 MESSAGE = b"Hello, World!"
   6 
   7 print("UDP target IP: %s" % UDP_IP)
   8 print("UDP target port: %s" % UDP_PORT)
   9 print("message: %s" % MESSAGE)
  10 
  11 sock = socket.socket(socket.AF_INET, # Internet
  12                      socket.SOCK_DGRAM) # UDP
  13 sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
Comment

PREVIOUS NEXT
Code Example
Python :: Python String to array using list() method 
Python :: python , cv2 change font type 
Python :: split dataframe into multiple parts 
Python :: assign more than one variable at a time on a single line in python 
Python :: Sort list in-place (Original list is modified) 
Python :: dont show certain legend labels 
Python :: what is a good django orm cookbook 
Python :: the coding train 
Python :: pe039 
Python :: email python library get all messages 
Python :: save impt 
Python :: django get all models 
Python :: algorithme permettant de passer au negatif une image 
Python :: transverse tensor in pytorch 
Python :: Python - Cara Mengurutkan String Secara alfabet 
Python :: longueur liste python 
Python :: how to make celery create missing queue 
Python :: OpenCV(3.4.11) Error: Assertion failed (_img.rows * _img.cols == vecSize) in CvCascadeImageReader::PosReader::get 
Python :: how to convert a axis label to non scientific notation in matploltlib 
Python :: pagerank formula 
Python :: jinja 2 iterate over dictionary 
Python :: return tuples form functions in Python 
Python :: import nifti to numpy 
Python :: read file in python 
Python :: pytorch starting 
Python :: abrir notebooks jupyter administrador de archivos 
Python :: missing number 
Python :: tkinter mouse loading cursor 
Python :: python pipe select where 
Python :: pbcopy stands for 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =