how exactly do binary files work in python?

Alex Martelli aleaxit at yahoo.com
Sun Mar 12 22:41:13 EST 2006


Grant Edwards <grante at visi.com> wrote:
   ...
> > What does a binary file do that a text file doesn't, aside
> > from not converting the end of line characters?
> 
> Nothing.  It's the end-of-line conversion that can break binary
> data.

I believe that a "control-Z" (ord(26)) in a file that's being read as
text, on Windows, is also taken as an end-of-file indication.


Alex



More information about the Python-list mailing list