Struct Pack Python

What is struct pack python module ?

This module performs conversions between Python values and C structs represented as Python strings. This can be used in handling binary data stored in files or from network connections, among other sources.It uses Format Strings as compact descriptions of the layout of the C structs and the intended conversion to/from Python values.

import struct
struct.pack("i",34)


# Result :  '"\x00\x00\x00'