Reading/writing binary data.

Ben Logan ben at wblogan.net
Mon Apr 8 12:11:55 EDT 2002


Hello,

I've been searching the Python (1.5) docs, but am unable to find any
functions to read/write binary data from/to a file.  Under the "open"
function I see that you can append a "b" to the mode to specify binary
mode, but that doesn't help me any.

For example, if I want to take a list of numbers like [64,66,67] and
write them to a file as binary, how would I do that?  I also need to
be able to control whether the data is written in big endian or little
endian format.

BTW, I'm running Redhat 7.1 on an Intel processor.

Thanks,
Ben

-- 
Ben Logan: ben at wblogan dot net
OpenPGP Key KeyID: A1ADD1F0

Overdrawn?  But I still have checks left!





More information about the Python-list mailing list