TextIOWrapper object, which has the io.TextIOWrapper.readlines(hint=-1/)
>method.
>
>
>>>> help(io.TextIOWrapper.readlines)
>readlines(self, hint=-1, /)
>Return a list of lines from the stream.
>
>hint can be specified to control the number of lines read: no more
&g
Hi folks,
import io
with io.open(filename, ‘r’) as fd:
lines = fd.readlines(hint=1000)
for line in lines:
# do something
I was just looking at the io module. io.open(‘file’, ‘r') returns an
io.TextIOWrapper object, which has the io.TextIOWrapper.readlines(hint=-1/)
m