Kent Johnson wrote:
> Roel Schroeven wrote:
> 
>> Danny Yoo wrote:
>> 
>> 
>>> Looking at pageimgs(): I'm not sure what 't' means in the open
>>> statement:
>>> 
>>> f = open(filename, "rt")
>> 
>> It's not a typo. 't' opens the file in text mode.
> 
> 
> Are you sure? Is that documented anywhere?

I thought it was, but actually it seems it's not. I know it from fopen
in C on Windows; it is documented in MSDN.

> Text mode is the default, you have to specify the 'b' if you want
> binary mode.

Indeed, so it seems. I just always use 't' since I do that in C too, and
Python never complained about it.

-- 
If I have been able to see further, it was only because I stood
on the shoulders of giants.  -- Isaac Newton

Roel Schroeven

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to