Skip to content

Instantly share code, notes, and snippets.

@juliengrenier
Created December 31, 2011 22:28
Show Gist options
  • Save juliengrenier/1545528 to your computer and use it in GitHub Desktop.
Save juliengrenier/1545528 to your computer and use it in GitHub Desktop.
Binary to string
str = '01001000011000010111000001110000011110010010000001001110011001010111011100100000010110010110010101100001011100100111001100100001'
print ''.join([chr(int(str[i:i+8],2)) for i in range(len(str)) if i % 8 ==0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment