pack a three byte int

p.lavarre at ieee.org p.lavarre at ieee.org
Thu Nov 9 19:54:44 EST 2006


> Help, what did you mean by the question?

How does Python express the idea:

i) Produce the six bytes '\x08' '\x01\x23\x45' '\x80' '\0' at run-time
when given the tuple (0x08, 0x12345, 0x80, 0).

ii) Produce the six bytes '\x12' '\0\0\0' '\x24' '\0' when given the
tuple (0x12, 0, 0x24, 0).

iii) And so on.

So far, everything I write is ugly.  Help?

> Looks like you ignored ...

I guess you're asking me to leave the mystery of my question alone long
enough to show more plainly that indeed I am trying to make sense of
every word of every answer.

I guess I should do that in separate replies, cc'ed back into this same
thread.  Please stay tuned.

Thanks in advance, Pat LaVarre




More information about the Python-list mailing list