binary conversion issues

Grant Edwards grante at visi.com
Tue Aug 8 12:53:46 EDT 2006


On 2006-08-08, godavemon <davefowler at gmail.com> wrote:

> I'm using python's struct and binascii modules to write some values
> from my parser to binary floats.  This works great for all of my binary
> files except one.  For some reason this file is saving to 836 (stated
> by my command shell) bytes instead of 832 like it should.

I'm just making a wild-ass guess since you didn't provide any
sample code or data, but it sounds like cr/lf translation
problem to me.  Make sure you open the files in binary mode
using the "b" flag.

-- 
Grant Edwards                   grante             Yow!  Is this "BIKINI
                                  at               BEACH"?
                               visi.com            



More information about the Python-list mailing list