Is it possible to append elements to a python generator?
I\'m currently trying to get all images from a set of disorganized folders and write them to a new directory
def files_gen(topdir='.'): for root, dirs, files in os.walk(topdir): # ... do some stuff with files for f in files: yield os.path.join(root, f) # ... do other stuff for f in files_gen(): print f