Michael Castleton a écrit :
>
>
> Bruno Desthuilliers wrote:
>> Michael Castleton a écrit :
>>> When I open a csv or txt file with:
>>>
>>> infile = open(sys.argv[1],'rb').readlines()
>>> or
>>> infile = open(sys.argv[1],'rb').read()
>>>
>>> and then look at the first few lines of the file there
Bruno Desthuilliers wrote:
>
> Michael Castleton a écrit :
>> When I open a csv or txt file with:
>>
>> infile = open(sys.argv[1],'rb').readlines()
>> or
>> infile = open(sys.argv[1],'rb').read()
>>
>> and then look at the first few lines of the file there is a carriage
>> return
>> +
>> li
Michael Castleton a écrit :
> When I open a csv or txt file with:
>
> infile = open(sys.argv[1],'rb').readlines()
> or
> infile = open(sys.argv[1],'rb').read()
>
> and then look at the first few lines of the file there is a carriage return
> +
> line feed at the end of each line - \r\n
Is ther
Thank you to both Steve and 7stud. You were right on with binary flag!
I thought I had tried everything...
Mike
--
View this message in context:
http://www.nabble.com/File-Object-behavior-tf3520070.html#a9825806
Sent from the Python - python-list mailing list archive at Nabble.com.
--
http://
On Apr 3, 12:26 pm, "7stud" <[EMAIL PROTECTED]> wrote:
> The file.writelines() documentation says that it
> doesn't add line separators. Is adding a carriage return something
> different?
No.
> Is this expected behavior?
According to Python in a Nutshell(p. 217), it is. On windows, in
text
mode
On Apr 3, 12:02 pm, Michael Castleton <[EMAIL PROTECTED]> wrote:
> When I open a csv or txt file with:
>
> infile = open(sys.argv[1],'rb').readlines()
> or
> infile = open(sys.argv[1],'rb').read()
>
> and then look at the first few lines of the file there is a carriage return
> +
> line feed at the
Michael Castleton wrote:
> When I open a csv or txt file with:
>
> infile = open(sys.argv[1],'rb').readlines()
> or
> infile = open(sys.argv[1],'rb').read()
>
> and then look at the first few lines of the file there is a carriage return
> +
> line feed at the end of each line - \r\n
> This is f