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

Method interact

tools/python-3.11.9-amd64/Lib/pydoc.py:2107–2126  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2105''')
2106
2107 def interact(self):
2108 self.output.write('\n')
2109 while True:
2110 try:
2111 request = self.getline('help> ')
2112 if not request: break
2113 except (KeyboardInterrupt, EOFError):
2114 break
2115 request = request.strip()
2116
2117 # Make sure significant trailing quoting marks of literals don't
2118 # get deleted while cleaning input
2119 if (len(request) > 2 and request[0] == request[-1] in ("'", '"')
2120 and request[0] not in request[1:-1]):
2121 request = request[1:-1]
2122 if request.lower() in ('q', 'quit'): break
2123 if request == 'help':
2124 self.intro()
2125 else:
2126 self.help(request)
2127
2128 def getline(self, prompt):
2129 """Read one line, using input() when appropriate."""

Callers 3

__call__Method · 0.95
do_interactMethod · 0.45
runMethod · 0.45

Calls 6

getlineMethod · 0.95
introMethod · 0.95
helpMethod · 0.95
stripMethod · 0.80
writeMethod · 0.45
lowerMethod · 0.45

Tested by

no test coverage detected