> (my smtp mail server has been down for a few hours, so you have some other
> responses.)
>
> yes, as far as I can tell from the docs, the 'b' flag doesn't matter in
> Unix/Linux. Note that I haven't actually been on a Unix machine since
> starting with Python, but it matches what else I know. A
2009/5/8 :
> On May 8, 5:08 am, Li Wang 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 ot
2009/5/8 Scott David Daniels :
> Li Wang wrote:
>>
>> So, if I am using python in Linux, do open('file', 'r') and
>> open('file', 'rb') work the same way?
>
> You get identical results, but you ar lying to the reader of your code.
> you should include the 'b' if what you want is bytes (or octets if
Li Wang wrote:
So, if I am using python in Linux, do open('file', 'r') and
open('file', 'rb') work the same way?
You get identical results, but you ar lying to the reader of your code.
you should include the 'b' if what you want is bytes (or octets if you
prefer), and not use it if what you exp
On May 8, 5:08 am, Li Wang 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" pa
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
Hi:
Problem solved
Thank you very much, it works, It is my own problem:)
All the best,
Li
2009/5/8 Li Wang :
> 2009/5/8 Chris Rebert :
>> On Thu, May 7, 2009 at 10:04 PM, Li Wang wrote:
>>> Hi all:
>>>
>
>> the file, e.g. open("the_file.xls", "rb")
>> Unlike *nix, Windows differentiates betwee
2009/5/8 Chris Rebert :
> On Thu, May 7, 2009 at 10:04 PM, Li Wang wrote:
>> Hi all:
>>
> the file, e.g. open("the_file.xls", "rb")
> Unlike *nix, Windows differentiates between binary and text files,
> hence the need for the "b" flag to specify which you're dealing with.
Hi
Thank you very much
Li Wang wrote:
Hi all:
I am trying to read a non-text file as a string by using Python
read(), however, it seems there is some thing wrong with it. I can use
read() on text file correctly, but unable to read .xls file correctly.
(The program can read any file correctly in Fedora 10)
Any idea ho
On Thu, May 7, 2009 at 10:04 PM, Li Wang wrote:
> Hi all:
>
> I am trying to read a non-text file as a string by using Python
> read(), however, it seems there is some thing wrong with it. I can use
> read() on text file correctly, but unable to read .xls file correctly.
> (The program can read an
Hi all:
I am trying to read a non-text file as a string by using Python
read(), however, it seems there is some thing wrong with it. I can use
read() on text file correctly, but unable to read .xls file correctly.
(The program can read any file correctly in Fedora 10)
Any idea how to solve this p
11 matches
Mail list logo