[Python-ideas] Add peekline(), peeklines(n) and optional maxlines argument to readlines()

John O'Connor jxo6948 at rit.edu
Tue Oct 4 18:03:35 CEST 2011


I thought of a somewhat elegant recipe for the readlines(maxlines) case:
f = open(...)itertools.islice(f, maxlines)


- John



More information about the Python-ideas mailing list