Did they remove file.readline () and file.readlines () from python 3.2? If so, what did they replace?
While there is no type filein Python 3.x, different types of module io, which replaces the old filetype maintain f.readline()andf.readlines() . You really do not need these methods, since they can be replaced by next(f)and list(f).
file
io
f.readline()
f.readlines()
next(f)
list(f)
Here is the documentation (well, tutorial) for Python 3.2. readlineand readlinesare still part of Python.
readline
readlines
, .
f = open("file", "r") f.readlines()
, Python 3.2.
EDIT: io ( ).
. ,
import readline
script, . , .