On Tue, Sep 21, 2010 at 1:23 PM, bob gailer <bgai...@gmail.com> wrote: > On 9/21/2010 12:34 PM, Joel Goldstick wrote: > > On Tue, Sep 21, 2010 at 12:03 PM, Joe Bennett <jammer10...@gmail.com> wrote: >> >> I have some binary files created by a program written in C++... Anyone >> have any experience with this and willing to share? ACSII test is >> easy, but not sure how the rest is encoded....???? >> >> >> >> >> -Joe >> _______________________________________________ >> Tutor maillist - tu...@python.org >> To unsubscribe or change subscription options: >> http://mail.python.org/mailman/listinfo/tutor > > fileobj = open(filename, mode='wb') > > Did you mean "rb"? OP says files were written by another program. > > will open the file. Do you have any documentation on the file structure? > > I have not done this, but googling around I found a python library called struct which has methods for reading C structured data, which sounds like what you are looking for. Go to your python shell, import struct and type help(struct) to start. Obviously you won't get far unless you have a spec for how your data is structured in the file
-- Joel Goldstick _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor