I have a Summer in front of me without any school, and I'd like to add a
new format for python print strings that will show any number in a
binary representation. For example:
[color=blue][color=green][color=darkred]
>>> '%b' % 3[/color][/color][/color]
11[color=blue][color=green][color=darkred]
>>> '%b' % 5[/color][/color][/color]
101
You get the idea. I've written functions that return strings, so that
part is done, but where do I go to tinker with the python interpreter to
add this new format?
Please don't argue with me about whether this is an advisable goal in
itself -- I'm using it as a method to learn about the internals of the
python language.
--
My public key:
gpg --recv-keys --keyserver www.mandrakesecure.net 0x8D10BFD5
new format for python print strings that will show any number in a
binary representation. For example:
[color=blue][color=green][color=darkred]
>>> '%b' % 3[/color][/color][/color]
11[color=blue][color=green][color=darkred]
>>> '%b' % 5[/color][/color][/color]
101
You get the idea. I've written functions that return strings, so that
part is done, but where do I go to tinker with the python interpreter to
add this new format?
Please don't argue with me about whether this is an advisable goal in
itself -- I'm using it as a method to learn about the internals of the
python language.
--
My public key:
gpg --recv-keys --keyserver www.mandrakesecure.net 0x8D10BFD5
Comment