|
struct.pack(format, v1, v2, ...)
|
|
struct.unpack(format, string)
|
|
struct.pack_into(format, buffer, offset, v1, v2, ...)
|
|
struct.unpack_from(fmt, buffer[,offset = 0])
|
|
pack('hhl', 1, 2, 3)
|
b'\x00\x01\x00\x02\x00\x00\x00\x03'
|
|
unpack('hhl', b'\x00\x01\x00\x02\x00\x00\x00\x03')
|
(1, 2, 3)
|
|
@
|
native
|
|
=
|
native
|
|
<
|
little-endian
|
|
>
|
big-endian
|
|
!
|
network (= big-endian)
|
|
c
|
char
|
1
|
|
b/B
|
signed/unsigned char
|
1
|
|
?
|
bool
|
1
|
|
h/H
|
signed/unsigned short
|
2
|
|
i/I
|
signed/unsigned int
|
4
|
|
l/L
|
signed/unsigned long
|
4
|
|
q/Q
|
signed/unsigned long long
|
8
|
|
f
|
float
|
4
|
|
d
|
double
|
8
|
|
s
|
bytes
|
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.