binary numbers

Darren Kirby bulliver at badcomputer.no-ip.com
Thu Oct 7 12:33:06 CEST 2004


quoth the Tim Roberts:
> 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.

Well, to defend my own ignorance here, I have no idea about editing a windows 
registry, in fact I do not run windows. Brad's original post was:

>This would be nice:

>import binary
>x = binary(5)

And the info I pointed him to was exactly what he asked for...
Seems a good thing that we have some "CS" types around here :)

-d
-- 
Part of the problem since 1976
http://badcomputer.no-ip.com
Get my public key from 
http://keyserver.linux.it/pks/lookup?op=index&search=bulliver
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20041007/5c5d1967/attachment.pgp>


More information about the Python-list mailing list