Name

readlines

Synopsis

                        f.readlines(size=-1)

Reads and returns a list of all lines in f’s file, each a string ending in \n. If size >0, readlines stops and returns the list after collecting data for a total of about size bytes, rather than reading all the way to the end of the file.

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.