ansi_escape/readme.md

1.0 KiB

ansi_escape

A pure python3 library for ansi VT-100 escape codes

See the doc/ folder and ansi_escape.py for documentation (WIP)
See the examples directory for examples/ You need to copy the ansi_escape.py file to the example/ directory to run the examples.
Since this library wraps around text sent to the terminal it only returns strings that need to be put inside a print() statement, example:

print(ansi_escape.color("fg", "red") + "Hello")

On the positive side that means that you easily can send output to a file using .write() or write it to the terminal using sys.stdout.write(). You are not limited by the limitations of print().

Features:

SGR (Select Graphic Rendition)
SGR foreground and background color support with support for 256 8-bit colors and 24-bit true color
SGR text formating like; underline, overline and bold text
Use the bell character
Free cursor movement
Clear parts of screen or line
Toggle keyboard leds