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,
)
| 120 | |
| 121 | |
| 122 | def 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 |
no test coverage detected