Re: Question about file objects...

2009-12-03 Thread nn
On Dec 2, 6:56 pm, Terry Reedy wrote: > J wrote: > > On Wed, Dec 2, 2009 at 09:27, nn wrote: > >>> Is there a way to read the file, one item at a time, delimited by > >>> commas WITHOUT having to read all 16,000 items from that one line, > >>> then split them out into a list or dictionary?? > > >

Re: Question about file objects...

2009-12-03 Thread r0g
J wrote: > Something that came up in class... > > when you are pulling data from a file using f.next(), the file is read > one line at a time. > > What was explained to us is that Python iterates the file based on a > carriage return as the delimiter. > But what if you have a file that has one li

Re: Question about file objects...

2009-12-02 Thread Terry Reedy
J wrote: On Wed, Dec 2, 2009 at 09:27, nn wrote: Is there a way to read the file, one item at a time, delimited by commas WITHOUT having to read all 16,000 items from that one line, then split them out into a list or dictionary?? File iteration is a convenience since it is the most common ca

Re: Question about file objects...

2009-12-02 Thread J
On Wed, Dec 2, 2009 at 09:27, nn wrote: >> Is there a way to read the file, one item at a time, delimited by >> commas WITHOUT having to read all 16,000 items from that one line, >> then split them out into a list or dictionary?? > File iteration is a convenience since it is the most common case.

Re: Question about file objects...

2009-12-02 Thread Andre Engels
On Wed, Dec 2, 2009 at 3:14 PM, J wrote: > Something that came up in class... > > when you are pulling data from a file using f.next(), the file is read > one line at a time. > > What was explained to us is that Python iterates the file based on a > carriage return as the delimiter. > But what if

Re: Question about file objects...

2009-12-02 Thread nn
On Dec 2, 9:14 am, J wrote: > Something that came up in class... > > when you are pulling data from a file using f.next(), the file is read > one line at a time. > > What was explained to us is that Python iterates the file based on a > carriage return as the delimiter. > But what if you have a fi

Question about file objects...

2009-12-02 Thread J
Something that came up in class... when you are pulling data from a file using f.next(), the file is read one line at a time. What was explained to us is that Python iterates the file based on a carriage return as the delimiter. But what if you have a file that has one line of text, but that one