生成器与文档结合

def population():
    ret = []
    with open('test.py', 'r', encoding='utf-8') as f:
        for i in f:
            ret.append()
    return ret


g = population()
print(g._next_())

 

posted @ 2018-05-03 20:56  未来的技术  阅读(77)  评论(0编辑  收藏  举报