MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / read

Method read

tools/python-3.11.9-amd64/Lib/idlelib/run.py:476–495  ·  view source on GitHub ↗
(self, size=-1)

Source from the content-addressed store, hash-verified

474 return True
475
476 def read(self, size=-1):
477 if self.closed:
478 raise ValueError("read from closed file")
479 if size is None:
480 size = -1
481 elif not isinstance(size, int):
482 raise TypeError('must be int, not ' + type(size).__name__)
483 result = self._line_buffer
484 self._line_buffer = ''
485 if size < 0:
486 while line := self.shell.readline():
487 result += line
488 else:
489 while len(result) < size:
490 line = self.shell.readline()
491 if not line: break
492 result += line
493 self._line_buffer = result[size:]
494 result = result[:size]
495 return result
496
497 def readline(self, size=-1):
498 if self.closed:

Callers 10

test_readMethod · 0.95
execfileMethod · 0.45
mainFunction · 0.45
LoadMethod · 0.45
__init__Method · 0.45
checksyntaxMethod · 0.45
loadfileMethod · 0.45
print_windowMethod · 0.45
view_fileFunction · 0.45
setUpClassMethod · 0.45

Calls 2

typeClass · 0.50
readlineMethod · 0.45

Tested by 2

test_readMethod · 0.76
setUpClassMethod · 0.36