[Tutor] binary, ascii, steganography

Alan Gauld alan.gauld at btinternet.com
Sat Mar 19 10:58:57 CET 2011


"Steven D'Aprano" <steve at pearwood.info> wrote

>> with how to get binary to text, so your suggestions are greatly 
>> appreciated.
>>  I'll get to it! (00000001 = a, 00000010 = b, ...)
>
> >>> int('01101110', 2)
> 110
> >>> chr(110)
> 'n'

And if you really want to use non standard character values you
could look at the string maketrans() function and string.translate()
method...

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/





More information about the Tutor mailing list