Viewing Binary Data

Bengt Richter bokr at
Sun Jan 8 14:10:31 EST 2006

On 6 Jan 2006 09:15:50 -0800, "Cuyler" <cuyler.jones at> wrote:

>I would like to display a file in its binary form (1s and 0s), but I'm
>having no luck... Any thoughts would be most appreciated.
What have you tried? "having no luck" doesn't tell us much, although it is
a phrase previously seen in use ;-/
Is this homework?

If the first character were 'C' what order would you like to see the bits?
(e.e., 1000011 (big-endian l-r) vs 1100001 (little-endian l-r)
Do you want to convert the whole file like a hex dump, except binary?
Want to give a clue as to output format? Gapped? Ascii at the right?
Bit numbers or hex byte offsets at the left?
Do you need a one-liner solution?

Bengt Richter

More information about the Python-list mailing list