jump to navigation

Python tricks December 11, 2012

Posted by peileppe in interlude, stats, tools.
Tags: , , ,
trackback

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

Comments»

No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: