def highlight ( text : str , color_code : int , bold : bool = False ) -> str : return '{}\033[{}m{}\033[0m' . format ( '\033[1m' if bold else '' , color_code , text , )
how to change color of highlight variable in python
Wraps the given string with terminal color codes .
def highlight(text: str, color_code: int, bold: bool=False) -> str:
    """Wraps the given string with terminal color codes.

    Args:
        text: The content to highlight.
        color_code: The color to highlight with, e.g. 'shelltools.RED'.
        bold: Whether to bold the content in addition to coloring.

    Returns:
        The highlighted string.
    """
    return '{}\033[{}m{}\033[0m'.format(
        '\033[1m' if bold else '',
        color_code,
        text,)