For completeness I was close this is the working code. def get_list_of_names(generator_arg): name_set = set() for name in generator_arg: base = os.path.basename(name.name) filename = os.path.splitext(base)[0] name_set.add(filename) return name_set
def data_attr(roots): """Get the root object and iter items.""" for name in names: directory = "output" write_name = name + ".csv" with open(os.path.join(directory, write_name), 'w', newline='') as csvf: race_writer = csv.writer(csvf, delimiter=',' ) thanks for your time and assistance. It's much appreciated Sayth -- https://mail.python.org/mailman/listinfo/python-list