binary numbers

Larry Bates lbates at syscononline.com
Tue Oct 5 18:35:07 EDT 2004


Brad Tilley wrote:
> How can I specify that a number be represented in binary format when 
> passing it to a function? I'm working with the Windows registry and 
> REG_BINARY values expect numbers in binary form...
> 
> This would be nice:
> 
> import binary
> x = binary(5)
> 
> Any tips???
> 
> Thanks,
> Brad

Integers are stored in memory as binary.

x=5

stores 5 in x in binary form.

Larry Bates



More information about the Python-list mailing list