cppio / format-term

ANSI escape codes in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

format-term

ANSI escape codes in Python

usage

ansi(bold, underlined, inverse, foreground, background) => str

By default ansi() does not actually change anything. bold, underlined, and inverse can be set to None to signify no change, True to enable them, or False to disable them. foreground and background can be set to an int in colors or brightcolors, a color object for true color, or None for no change.

reset() will reset the terminal. It is equivalent to setting bold, underlined, and inverse to False, and setting foreground and background to colors.default.

Convenience functions

bold(string) underlined(string) inverse(string) foreground(color, string) background(color, string) These functions wrap a str and set the respective property.

About

ANSI escape codes in Python

License:MIT License


Languages

Language:Python 100.0%