Reading binary files

Albert Hopkins marduk at letterboxes.org
Mon Aug 24 10:43:59 EDT 2009


On Mon, 2009-08-24 at 10:35 -0400, Ronn Ross wrote:
> I need to read a binary file. When I open it up in a text editor it is
> just junk. Does Python have a class to help with this? 

Yes, the "file" class.

>>> myfile = open('/path/to/binary/file', 'rb')

-a





More information about the Python-list mailing list