def somefunc(): for action, files in results: full_filename = os.path.join(path_to_watch, files) theact = ACTIONS.get(action, "Unknown") yield str(full_filename) + " " + str(theact)
? Here is an example if that doesn't work, using yield, to show how to use yield: def yi(x): while x > 0: yield str(x) x -= 1 >>> yi(4) <generator object at 0x01FA3C88> >>> a=yi(4) >>> a.next() '4' >>> a.next() '3' >>> a.next() '2' >>> a.next() '1' >>> a.next() Traceback (most recent call last): File "<pyshell#151>", line 1, in <module> a.next() StopIteration >>> -- http://mail.python.org/mailman/listinfo/python-list