示例#1
0
def list_records(username):
    result = []
    for k in  book.keys():
        record = book.record(k)
        if record['NAME'] == username:
            result.append(record)
    return result
示例#2
0
def print_records(username):
    for k in  book.keys():
        record = book.record(k)
        if record['NAME'] == username:
            print record['TEXT']
示例#3
0
def generator_records(username):
    for k in book.keys():
        record = book.record(k)
        if record['NAME'] == username:
            yield record
示例#4
0
def comprehensio_2_records(username):
    return (record for record in
            (book.record(k) for k in book.keys())
        if record['NAME'] == username)
示例#5
0
def comprehensio_1_records(username):
    return [record for record in
            [book.record(k) for k in book.keys()]
        if record['NAME'] == username]