Created
November 9, 2012 09:54
-
-
Save Apkawa/4044922 to your computer and use it in GitHub Desktop.
binary number to text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import binascii | |
>>> bin(int(binascii.hexlify('hello'), 16)) | |
'0b110100001100101011011000110110001101111' | |
>>> n = int('0b110100001100101011011000110110001101111', 2) | |
>>> binascii.unhexlify('%x' % n) | |
'hello' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment