def stylize ( text , styles , reset = True ) : terminator = attr ( "reset" ) if reset else "" return "{}{}{}" . format ( "" . join ( styles ) , text , terminator )
how to formai in italic on python
conveniently styles your text as and resets ANSI codes at its end .
def stylize(text, styles, reset=True):
    """conveniently styles your text as and resets ANSI codes at its end."""
    terminator = attr("reset") if reset else ""
    return "{}{}{}".format("".join(styles), text, terminator)