binary numbers

Tim Roberts timr at probo.com
Thu Oct 7 01:27:50 EDT 2004


Brad Tilley <bradtilley at gmail.com> wrote:
>
>Darren Kirby wrote:
>> 
>>  I think our friend is looking for a module or function that turns 5 into 101 
>> (or perhaps 00000101)
>> 
>> Brad, have a look here:
>> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/219300
>> 
>> -d
>
>Thanks, this is what I need.

No, it isn't.  Registry REG_BINARY values are NOT binary, in the sense of
"a string of ones and zeros".  REG_BINARY means "an arbitrary list of
bytes".  The string "ABCD" is a perfectly legitimate value for a REG_BINARY
registry value; it will display in a hex dump as "41 42 43 44 00".
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list