from itertools import islice with open(“1.txt") as f: for a in islice(f,0,2): print(a) 相关文章: 2021-11-16 2022-02-24 2022-02-19 2021-08-04 2021-12-05