> >>> hexa = '0x87BE' > >>> upper = int(hexa[2:4], 16) > >>> lower = int(hexa[4:6], 16) FWIW : You don't need to strip the '0x' from the front, int() is smart enough to do that automatically for base 16 conversions... Alan G.