MCPcopy
hub / github.com/prompt-toolkit/ptpython / interactive_shell

Function interactive_shell

examples/asyncio-python-embed.py:33–45  ·  view source on GitHub ↗

Coroutine that starts a Python REPL from which we can access the global counter variable.

()

Source from the content-addressed store, hash-verified

31
32
33async def interactive_shell() -> None:
34 """
35 Coroutine that starts a Python REPL from which we can access the global
36 counter variable.
37 """
38 print(
39 'You should be able to read and update the "counter[0]" variable from this shell.'
40 )
41 try:
42 await embed(globals=globals(), return_asyncio_coroutine=True, patch_stdout=True)
43 except EOFError:
44 # Stop the loop when quitting the repl. (Ctrl-D press.)
45 loop.stop()
46
47
48async def main() -> None:

Callers 1

mainFunction · 0.85

Calls 1

embedFunction · 0.90

Tested by

no test coverage detected