Does any one recognize this binary data storage format

Bengt Richter bokr at oz.net
Wed Aug 10 09:23:22 EDT 2005


On 10 Aug 2005 05:30:37 -0700, geskerrett at hotmail.com wrote:

>Thanks so much for this.  It is exactly what I was looking for.
>
>If I am simply reading the bytes from disk, would I still need to
>convert the these values HEX characters first with Hexlify, or is there
>a more direct route ?
>ie. convert them to the double float directly from the byte values ?
Yes. Use struct.unpack ;-)

BTW, my second post was doing ''.join(chr(int(h[i:i+2],16)) for i in xrange(0,16,2))
to undo the hexlify you had done (I'd forgotten that there's a binascii.unhexlify ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list