At Thursday 9/11/2006 22:24, [EMAIL PROTECTED] wrote:

Perhaps Python can't concisely say three-byte int ...

But Python can say six-nybble hex:

>>> import binascii
>>> cdb = binascii.unhexlify('%02X%06X%02X%02X' % (0x08, 0x12345, 0x80, 0))
>>> binascii.hexlify(cdb)
'080123458000'

The only problem I can see is that this code is endianness-dependent; the suggested versions using pack(">...") not. But this may not be of concern to you.


--
Gabriel Genellina
Softlab SRL
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to