On Tue, Aug 19, 2008 at 7:39 PM, ssecorp <[EMAIL PROTECTED]> wrote: > I want a parse a file of the format: > movieId > customerid, grade, date > customerid, grade, date > customerid, grade, date > etc. > > so I could do with open file as reviews and then for line in reviews. > > but first I want to take out the movie id so I use an iterator. > > then i want to iterate through all the rows, but how can I do: > while movie_iter != None: > > because that doesn't work, itraises an exception, StopItreation, which > according to the documentation it should. But catching an exception > can't be the standard way to stop iterating right? >
you can use for loop: for line in movie_iter: ... -- Best Regards, Leo Jay -- http://mail.python.org/mailman/listinfo/python-list