> FAILS > ---------- > >>> value = 1234567890 > >>> hexoutput = hex('%d' % (value)) > Traceback (most recent call last): > File "<stdin>", line 1, in ? > TypeError: hex() argument can't be converted to hex Just don't convert the number to a string, e.g: >>> value = 1234567890 >>> hexoutput = hex(value) >>> hexoutput '0x499602d2' =Tony.Meyer