python读取文件后切片

 

from itertools import islice
with open(“1.txt") as f:
    for a in islice(f,0,2):
        print(a)
相关文章
相关标签/搜索