Byte oriented data types in python

Steve Holden steve at holdenweb.com
Sun Jan 25 12:12:58 EST 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.

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list