MCPcopy
hub / github.com/scrapy/scrapy / start_python_console

Function start_python_console

scrapy/utils/console.py:122–138  ·  view source on GitHub ↗

Start Python console bound to the given namespace. Readline support and tab completion will be used on Unix, if available.

(
    namespace: dict[str, Any] | None = None,
    banner: str = "",
    shells: Iterable[str] | None = None,
)

Source from the content-addressed store, hash-verified

120
121
122def start_python_console(
123 namespace: dict[str, Any] | None = None,
124 banner: str = "",
125 shells: Iterable[str] | None = None,
126) -> None:
127 """Start Python console bound to the given namespace.
128 Readline support and tab completion will be used on Unix, if available.
129 """
130 if namespace is None:
131 namespace = {}
132
133 try:
134 shell = get_shell_embed_func(shells)
135 if shell is not None:
136 shell(namespace=namespace, banner=banner)
137 except SystemExit: # raised when using exit() in python code.interact
138 pass

Callers 1

startMethod · 0.90

Calls 1

get_shell_embed_funcFunction · 0.85

Tested by

no test coverage detected