MCPcopy Index your code
hub / github.com/RustPython/RustPython / interact

Method interact

Lib/pydoc.py:2070–2090  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2068''')
2069
2070 def interact(self):
2071 self.output.write('\n')
2072 while True:
2073 try:
2074 request = self.getline('help> ')
2075 except (KeyboardInterrupt, EOFError):
2076 break
2077 request = request.strip()
2078 if not request:
2079 continue # back to the prompt
2080
2081 # Make sure significant trailing quoting marks of literals don't
2082 # get deleted while cleaning input
2083 if (len(request) > 2 and request[0] == request[-1] in ("'", '"')
2084 and request[0] not in request[1:-1]):
2085 request = request[1:-1]
2086 if request.lower() in ('q', 'quit', 'exit'): break
2087 if request == 'help':
2088 self.intro()
2089 else:
2090 self.help(request)
2091
2092 def getline(self, prompt):
2093 """Read one line, using input() when appropriate."""

Callers 15

__call__Method · 0.95
do_interactMethod · 0.45
runMethod · 0.45
mainFunction · 0.45
test_ps1Method · 0.45
test_ps2Method · 0.45
test_console_stderrMethod · 0.45
test_syntax_errorMethod · 0.45
test_unicode_errorMethod · 0.45
test_sysexcepthookMethod · 0.45

Calls 7

getlineMethod · 0.95
introMethod · 0.95
helpMethod · 0.95
lenFunction · 0.85
writeMethod · 0.45
stripMethod · 0.45
lowerMethod · 0.45