[Pythonmac-SIG] binary file strangeness
Guido van Rossum
guido@cnri.reston.va.us
Mon, 14 Sep 1998 17:12:31 -0400
> I'm trying to write a MIDI sysex editor (starting with working with the
> Roland GP-100) in Python and have come across a little strangeness.
>
> Certain bytes having a value of 0x10 are being read as having a value of
> 0x13. I see the 0x10 values from Norton Disk Editor, or from reading the
> file with a Tcl script.
Sounds like you're opening binary files in text mode. Use open(file,
"rb") to open files in binary mode. Good luck!
--Guido van Rossum (home page: http://www.python.org/~guido/)