How to get the n next values of a generator in a list (python)

后端 未结 5 1451
醉话见心
醉话见心 2020-11-28 11:08

I have made a generator to read a file word by word and it works nicely.

def word_reader(file):
    for line in open(file):
        for p in line.split():
           


        
5条回答
提交回复
热议问题