Re: csv iterator question

2008-05-24 Thread David Jackson
Thanks, Ethan. that was a great solution. i just tested it. On Fri, May 23, 2008 at 7:08 PM, Ethan Furman <[EMAIL PROTECTED]> wrote: > davidj411 wrote: > > When you save an open file to a variable, you can re-use that variable >> for membership checking. >> it does not seem to be that way with

Re: csv iterator question

2008-05-23 Thread alex23
On May 24, 6:36 am, davidj411 <[EMAIL PROTECTED]> wrote: > but when i try to iterate through it again, it appears to print > nothing (no error either). the file is exhausted? No, the iterator is finished. Iterators are generally use-once: "The intention of the protocol is that once an iterator's

Re: csv iterator question

2008-05-23 Thread Marc 'BlackJack' Rintsch
On Fri, 23 May 2008 13:36:55 -0700, davidj411 wrote: > example of open method on file object: > fhandle=open(filename).readelines() Here the name `fhandle` is somewhat misleading. You don't bind the file object to that name, but the result of the call of the `readlines()` method. Which is a lis

Re: csv iterator question

2008-05-23 Thread Ethan Furman
davidj411 wrote: When you save an open file to a variable, you can re-use that variable for membership checking. it does not seem to be that way with the csv.reader function, even when set to a variable name. what is the best way to store the open CSV file in memory or do i need to open the fil

Re: csv iterator question

2008-05-23 Thread Mike Driscoll
On May 23, 3:36 pm, davidj411 <[EMAIL PROTECTED]> wrote: > When you save an open file to a variable, you can re-use that variable > for membership checking. > it does not seem to be that way with the csv.reader function, even > when set to a variable name. > > what is the best way to store the open

csv iterator question

2008-05-23 Thread davidj411
When you save an open file to a variable, you can re-use that variable for membership checking. it does not seem to be that way with the csv.reader function, even when set to a variable name. what is the best way to store the open CSV file in memory or do i need to open the file each time? exampl