Newbie: Manipulating Binary Files

Bjorn Pettersen pbjorn at uswest.net
Sat Dec 30 13:49:39 EST 2000


Take a look at the struct module. If you just want to look at the bytes,
opening the file in binary mode:

  binaryfile = open('foo.mp3', 'rb')
  data = binaryfile.read()

will work...

all-depends-on-what-you-want-to-do-with-the-bytes'ly y'rs
-- bjorn

Gerson Kurz wrote:

> How do you efficiently manipulate binary files in Python ? Say, you
> want to extract a data frame from a MP3 file. Is there some package
> that allows manipulation of bytes in the usual [] notation ?




More information about the Python-list mailing list