run_command#
- scikitplot._ipymagic.run_command(args, *, stdin=None, settings=None, out=None, err=None)[source]#
Run one
scikitplotcommand and return its result.- Parameters:
- argsstr or sequence of str
The command line after
scikitplot("env plan -n demo") or its arguments.- stdinstr or None, default=None
Text given to the command on standard input (the cell of
%%scikitplot); the command then runs in a subprocess.- settingsMagicSettings or None, default=None
Timeout, isolation, streaming, raising; defaults when None.
- out, errtext stream or None, default=None
Where the output is shown;
sys.stdout/sys.stderrat call time when None.
- Returns:
- CommandResult
Exit status, captured output, timing and, for
--format json, the parsed data.
- Raises:
- MagicUsageError
For arguments that name no command (nothing is run).
- CommandFailedError
For a non-zero exit status when
settings.raise_on_error.- KeyboardInterrupt
After stopping the command, when interrupted.
- Parameters:
- Return type:
Examples
>>> import io >>> from scikitplot._ipymagic import run_command >>> result = run_command("info --format json", out=io.StringIO()) >>> result.ok, sorted(result.data) (True, ['platform', 'python', 'scikitplot'])
Gallery examples#
Clean a Prompt in a Notebook Cell with %%scikitplot
Clean a Prompt in a Notebook Cell with %%scikitplot
Inspect and Self-test the MCP Server from a Notebook
Inspect and Self-test the MCP Server from a Notebook