Byte oriented data types in python

Steve Holden steve at
Sun Jan 25 18:12:58 CET 2009

Ravi wrote:
>> Take a look at the struct and ctypes modules.
> struct is really not the choice. it returns an expanded string of the
> data and this means larger latency over bluetooth.
If you read the module documentation more carefully you will see that it
"converts" between the various native data types and character strings.
Thus each native data type occupies only as many bytes as are required
to store it in its native form (modulo any alignments needed).

> ctypes is basically for the interface with libraries written in C
> (this I read from the python docs)
I believe it *is* the struct module you need.

Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC    

More information about the Python-list mailing list