PyDocs

Nav

Binary Data Services

pack

struct

function
  • pack(format, v1, v2, ...)
Pack values and return the packed bytes.

Return a bytes object containing the provided values packed according
to the format string.  See help(struct) for more on format strings.
1 Example
>>> import struct
>>> struct.pack('>h', 1023)
b'\x03\xff'
>>> struct.pack('<h', 1023)
b'\xff\x03'
from the Python docs
See Also
No see-alsos for struct/pack
0 Notes
No notes for pack