On Feb 2, 2005, at 10:19, Ewald Ertl wrote:
Hi!
Using binary operations:
'0xbe'a='0x87BE' str(hex(int(a,16) & 0xFF))'0x87'str(hex((int(a,16) & 0xFF00) / 0xFF))
HTH Ewald
Actually, the int conversions aren't even necessary.
>>> hex(0x87BE & 0xFF) '0xbe' >>> hex((0x87BE & 0xFF00) / 0xFF) '0x87'
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting and sweating as you run through my corridors... How can you challenge a perfect, immortal machine?"
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor