This seems to work as a starter.
def return_files(file_list):
""" Take a list of files and return file when called
Calling function to supply attributes
"""
for filename in sorted(file_list):
with open(dir_path + filename) as fd:
doc =
> The way I'm reading your code, it's not the generator that's the
> difference here. Consider these lines:
>
> > for item in doc['meeting']['race']:
> >
> > def return_files(file_list):
> > for filename in sorted(file_list, *attribs):
> > for item in doc([attribs]):
>
>
On Sun, Sep 11, 2016 at 10:46 AM, Sayth Renshaw wrote:
> Hi
>
> I want to create a generator function that supplies my calling function a
> file, how though do I get the generator to accept attributes in the argument
> when called?
>
> This works not as a generator
The
Hi
I want to create a generator function that supplies my calling function a file,
how though do I get the generator to accept attributes in the argument when
called?
This works not as a generator
for filename in sorted(file_list):
with open(dir_path + filename) as fd:
doc =