MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / do_py

Method do_py

cmd2/cmd2.py:5014–5020  ·  view source on GitHub ↗

Run an interactive Python shell. :return: True if running of commands should stop.

(self, _: argparse.Namespace)

Source from the content-addressed store, hash-verified

5012
5013 @with_argparser(_build_py_parser)
5014 def do_py(self, _: argparse.Namespace) -> bool | None:
5015 """Run an interactive Python shell.
5016
5017 :return: True if running of commands should stop.
5018 """
5019 # self.last_result will be set by _run_python()
5020 return self._run_python()
5021
5022 @classmethod
5023 def _build_run_pyscript_parser(cls) -> Cmd2ArgumentParser:

Callers

nothing calls this directly

Calls 1

_run_pythonMethod · 0.95

Tested by

no test coverage detected