jump to navigation

Python tricks December 11, 2012

Posted by peileppe in interlude, stats, tools.
Tags: , , ,
add a comment

Just found a neat little trick to convert decimal into hexadecimal and vice-verse – you have to use python (provided with OS X)

the command to obtain a hexadecimal number out of a decimal (e.g : 2550) is as follow :

>>> print “%x” % 2550

9f6

The reverse is :

>>> print int(“9f6”,16)

2550

Hope this will be useful –

Advertisements