astromodels.utils.sys_tools module
- astromodels.utils.sys_tools.colored(text, color=None, on_color=None, attrs=None, ansi_code=None)[source]
Colorize text, while stripping nested ANSI color sequences. Author: Konstantin Lepa <konstantin.lepa@gmail.com> / termcolor Available text colors:
red, green, yellow, blue, magenta, cyan, white.
- Available text highlights:
on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white.
- Available attributes:
bold, dark, underline, blink, reverse, concealed.
Example
colored(‘Hello, World!’, ‘red’, ‘on_grey’, [‘blue’, ‘blink’]) colored(‘Hello, World!’, ‘green’)
- astromodels.utils.sys_tools.cprint(text, color=None, on_color=None, attrs=None)[source]
Print colorize text. Author: Konstantin Lepa <konstantin.lepa@gmail.com> / termcolor It accepts arguments of print function.