Python 2.6, File read() problems in Windows Xp
Li Wang
li.wang.d at gmail.com
Fri May 8 09:47:51 EDT 2009
2009/5/8 <pruebauno at latinmail.com>:
> On May 8, 5:08 am, Li Wang <li.wan... at gmail.com> wrote:
>> Hi Dave:
>> Thank you very much for you explanation:)
>>
>> > Chances are you forgot the "b" parameter to open(). Unnecessary in Unix, it
>> > tells the library to *not* translate \r\n to \n upon read, or the inverse
>> > on write. In other words, with the "b" parameter, the file is read in
>> > unchanged.
>>
>> So, if I am using python in Linux, do open('file', 'r') and
>> open('file', 'rb') work the same way?
>>
>> Thanks,
>>
>> Best regards,
>> Li
>
> In old Python up to 2.6, YES.
Thank you:D
--
Li
------
Time is all we have
and you may find one day
you have less than you think
More information about the Python-list
mailing list