struct.Struct lets you encode Python objects into structured memory.
It accepts a format string, and optionally a buffer and offset to/from
which to read/write the structure. What do you think of random access
for the results?
(unproduced)
30
Does this take a PEP, or just a patch submission?
It accepts a format string, and optionally a buffer and offset to/from
which to read/write the structure. What do you think of random access
for the results?
(unproduced)
>>packer= struct.Struct( 'IIIf255p' )
>>packer.pack_i nto( buf, off, 10, 20, 30, 0.5, 'abc' )
>>packer.unpack _from( buf, off, 2 ) #reads field 2
>>packer.pack_i nto( buf, off, 10, 20, 30, 0.5, 'abc' )
>>packer.unpack _from( buf, off, 2 ) #reads field 2
Does this take a PEP, or just a patch submission?
Comment