Screwing Up looping in Generator

Sayth Renshaw flebber.crue at
Tue Jan 3 21:09:35 EST 2017

Untested as i wrote this in notepad at work but, if i first use the generator to create a set of filenames and then iterate it then call the generator anew to process file may work?

Good idea or better available?

def get_list_of_names(generator_arg):
    name_set = set()
    for name in generator_arg:
        base = os.path.basename(
        filename = os.path.splitext(base)[0]
    return name_set

 for file_name in name_set: 
     directory = "output"
         with open(os.path.join(directory, filename, 'w', newline='') as csvf: 
            for file in rootobs: 
              # create and write csv 


More information about the Python-list mailing list