from itertools import islice f=open("pyhpd.txt") for a in islice(f,2,6): print(a) 转载于:https://www.cnblogs.com/howhy/p/8583229.html