On Wed, Jan 4, 2017 at 8:19 AM, Deborah Swanson <pyt...@deborahswanson.net> wrote: > while True: > try: > file = files.next() > except StopIteration: > break
Small side point: Try to avoid calling a generator object's .next() method directly. Normally, when you _do_ want to do this, you should be calling next(files). In Python 3, the magic method is now __next__(), which emphasizes that it's for defining, not calling. As others have pointed out, though, the for loop is the correct tool for this job. ChrisA -- https://mail.python.org/mailman/listinfo/python-list