forked from Rust-related/RustPython
11 lines
161 B
Python
11 lines
161 B
Python
|
|
import struct
|
|
|
|
data = struct.pack('IH', 14, 12)
|
|
assert data == bytes([14, 0, 0, 0, 12, 0])
|
|
|
|
v1, v2 = struct.unpack('IH', data)
|
|
assert v1 == 14
|
|
assert v2 == 12
|
|
|