MCPcopy
hub / github.com/Textualize/rich / print

Function print

rich/__init__.py:53–74  ·  view source on GitHub ↗

r"""Print object(s) supplied via positional arguments. This function has an identical signature to the built-in print. For more advanced features, see the :class:`~rich.console.Console` class. Args: sep (str, optional): Separator between printed objects. Defaults to " ".

(
    *objects: Any,
    sep: str = " ",
    end: str = "\n",
    file: Optional[IO[str]] = None,
    flush: bool = False,
)

Source from the content-addressed store, hash-verified

51
52
53def print(
54 *objects: Any,
55 sep: str = " ",
56 end: str = "\n",
57 file: Optional[IO[str]] = None,
58 flush: bool = False,
59) -> None:
60 r"""Print object(s) supplied via positional arguments.
61 This function has an identical signature to the built-in print.
62 For more advanced features, see the :class:`~rich.console.Console` class.
63
64 Args:
65 sep (str, optional): Separator between printed objects. Defaults to " ".
66 end (str, optional): Character to write at end of output. Defaults to "\\n".
67 file (IO[str], optional): File to write to, or None for stdout. Defaults to None.
68 flush (bool, optional): Has no effect as Rich always flushes output. Defaults to False.
69
70 """
71 from .console import Console
72
73 write_console = get_console() if file is None else Console(file=file)
74 return write_console.print(*objects, sep=sep, end=end)
75
76
77def print_json(

Callers 1

__init__.pyFile · 0.70

Calls 3

get_consoleFunction · 0.85
ConsoleClass · 0.85
printMethod · 0.80

Tested by

no test coverage detected