You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
filip 00db6e6298
Update 'readme.md'
2 years ago
doc more functions and documentation 2 years ago
examples more functions and documentation 2 years ago
ansi_escape.py more functions and documentation 2 years ago
readme.md Update 'readme.md' 2 years ago

readme.md

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