Consolor provides highlighting functions for terminals.
Project description
Copyright (c) 2013-2014, Friedrich Paetzke (f.paetzke@gmail.com) All rights reserved.
Consolor provides highlighting functions for terminals.
It comes with there 3 functions:
- get_line
Returns a string with the given formatting.
- print_line
Prints a string with the given formatting.
- update_line
Overwrites the output of the current line and prints s on the same line without a new line.
All these functions accept the following formatting parameters:
bold: bool, default False
underline: bool, default False
blinking: bool, default False
color: str, default None
bgcolor: str, default None
Some examples:
import consolor
consolor.print_line('light green', color=consolor.Color.LightGreen)
consolor.print_line('underline', underline=True)
consolor.print_line('green bg', bgcolor=consolor.BgColor.Green)
consolor.update_line('0%')
consolor.update_line('100%')
print()
For more colors and background colors see consolor.Color and consolor.BgColor.
You can also use it in builtin print():
import consolor
print(consolor.Color.Red, 'Red')
print('Red two')
print(consolor.Color.Reset, end='') # You have to handle resetting your self.
print('Not Red')
print(consolor.BgColor.Red, 'Red')
print('Red two', consolor.BgColor.Reset)
print('None')
To install consolor use pip.
pip install consolor
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for consolor-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 161f31eb5d17ddae5cb49086c36d6bbd0b52a1222c029459a583a550c9f043cc |
|
MD5 | 9f671db03fa00795b3b262223f931e06 |
|
BLAKE2b-256 | fcb8fe3a3effa2c3f9f22cc1ba0833f4d8873194677c75aa9226e68b0a93f3a8 |