import msgpack id_ = 44 byte2 = 0 data_values = 6000 the_last_4_bytes = 42 package = [id_, byte2, data_values, the_last_4_bytes] masgpack.packb(package) # send the dataOn the other side:
import msgpack # receive the UDP datagram data = msgpack.unpackb(package) # process the datamsgpack