def structs2records(structs):
    """convert one or more structs and generate dictionaries"""
    try:
        n = len(structs)
    except TypeError:
        # no array
        yield struct2dict(structs)
        # just 1
        return
    for i in range(n):
        struct = structs[i]
        yield struct2dict(struct)
def structs2records ( structs ) : try : n = len ( structs ) except TypeError : yield struct2dict ( structs ) return for i in range ( n ) : struct = structs [ i ] yield struct2dict ( struct )
convert one or more structs and generate dictionaries