Б
Size: a a a
Б
b
Б
Б
Б
Б
Б
Б
СК
py3
type_, packet = 0xf, b"vsem pohui"
packet_len = len(packet)
packed = bytearray()
packed.append(type_)
packed.extend(bytes((packet_len & 0xff, packet_len >> 8)))
print(bytes(packed)+packet)
b'\x0f\n\x00vsem pohui'
b
Б
Б
СК
py3
type_, packet = 0xf, b"vsem pohui"
packet_len = len(packet)
packed = bytearray()
packed.append(type_)
packed.extend(bytes((packet_len & 0xff, packet_len >> 8)))
print(bytes(packed)+packet)
b'\x0f\n\x00vsem pohui'
Б
py3
type_, packet = 0xf, b"vsem pohui"
packet_len = len(packet)
packed = bytearray()
packed.append(type_)
packed.extend(bytes((packet_len & 0xff, packet_len >> 8)))
print(bytes(packed)+packet)
b'\x0f\n\x00vsem pohui'
СК
Б
Б
b
D
Б