noob stuck on reading double

Joe Riopel goon12 at gmail.com
Tue Jan 29 14:21:01 EST 2008


Since you're unpacking it with the 'd' format character I am assuming
a "doubleword" field is a double. You said you had 113 of them in the
binary file. You should be doing something like this:

                file = open('data.bin', 'rb')
                file.seek(0)
                raw = file.read()
                unpacked = unpack('113d', raw)
                for i in range(0,113):
                        print unpacked[i]
                file.close()



More information about the Python-list mailing list