Re: Viewing Binary Data

2006-01-08 Thread [EMAIL PROTECTED]
This recipe is a good place to start:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440528

Cheers

Rich.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Viewing Binary Data

2006-01-08 Thread Claudio Grondi
Cuyler wrote:
 Hello,
 
 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.
 
 Cheers!
 
 Cuyler
 
You may consider to check out the latest by me started thread in this 
newsgroup with the subject: Does Python allow access to some of the 
implementation details?, which surprizingly deals mainly with getting 
bits out of strings and integers and provides appropriate code.

Claudio
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Viewing Binary Data

2006-01-08 Thread Peter Hansen
Cuyler 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.

I'm sure the list archives (visible via Google Groups and other means) 
has answers to similar questions in the past.  Also the online Python 
CookBook probably has at least one recipe that would help.  Have you 
tried searching online at all?

-Peter

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Viewing Binary Data

2006-01-08 Thread Paul Watson
Cuyler 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.

If you are on a UNIX system, or on Windows with Cygwin, you can use the 
'od' command to dump a file in hex or octal.

man od
od -Ax -tx1
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Viewing Binary Data

2006-01-08 Thread Bengt Richter
On 6 Jan 2006 09:15:50 -0800, Cuyler [EMAIL PROTECTED] wrote:

Hello,

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., 111 (big-endian l-r) vs 111 (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?

Regards,
Bengt Richter
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Viewing Binary Data

2006-01-08 Thread Rod Haper
Paul Watson wrote:
 Cuyler 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.
 
 
 If you are on a UNIX system, or on Windows with Cygwin, you can use the 
 'od' command to dump a file in hex or octal.
 
 man od
 od -Ax -tx1


And if you're on a Linux system and have KDE loaded, use the KHexEdit 
utility.  KHexEdit can display the file in hexadecimal, decimal, octal, 
binary or text format, swap endians, search, filter, etc.  It's a very 
sweet utility.
-- 
http://mail.python.org/mailman/listinfo/python-list


Viewing Binary Data

2006-01-07 Thread Cuyler
Hello,

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.

Cheers!

Cuyler

-- 
http://mail.python.org/mailman/listinfo/python-list