binary literal

superpollo user at example.net
Thu Jul 23 11:04:24 CEST 2009


Hendrik van Rooyen wrote:
> On Wednesday 22 July 2009 12:03:44 superpollo wrote:
> 
> 
>>can i do something like the above, but using a *binary* number? (e.g.
>>00101101 instead of 45) ?
> 
> 
> 00101101 is not hex 45.
> hex 45 is 01000101
> 

whoopsie daisie!

> 
>>>>chr(int('01000101',2))
> 
> 'E'
> 

much obliged.

bye



More information about the Python-list mailing list