MCPcopy Create free account
hub / github.com/pexpect/pexpect / readlines

Method readlines

pexpect/spawnbase.py:499–513  ·  view source on GitHub ↗

This reads until EOF using readline() and returns a list containing the lines thus read. The optional 'sizehint' argument is ignored. Remember, because this reads until EOF that means the child process should have closed its stdout. If you run this method on a child t

(self, sizehint=-1)

Source from the content-addressed store, hash-verified

497 return iter(self.readline, self.string_type())
498
499 def readlines(self, sizehint=-1):
500 '''This reads until EOF using readline() and returns a list containing
501 the lines thus read. The optional 'sizehint' argument is ignored.
502 Remember, because this reads until EOF that means the child
503 process should have closed its stdout. If you run this method on
504 a child that is still running with its stdout open then this
505 method will block until it timesout.'''
506
507 lines = []
508 while True:
509 line = self.readline()
510 if not line:
511 break
512 lines.append(line)
513 return lines
514
515 def fileno(self):
516 '''Expose file descriptor for a file-like interface

Callers 3

loginMethod · 0.80
test_readlinesMethod · 0.80

Calls 1

readlineMethod · 0.95

Tested by 2

test_readlinesMethod · 0.64