print with color on the console.
Install
pip install console-color
Features
It allows you to register your own styles.
Supports fore, background, style (Bold, Italic, URL, …), and you can do permutations, really flexible.
Well documented, you can find all the usage form test.py folder and console_color.ipynb
Usage
from console_color import *
# cprint(text, fg=, bg=, style=)
cprint('...', RGB.WHITE, '#ff0000', Style.BOLD + Style.URL)
cprint('...', (255, 0, 0), RGB.YELLOW, Style.BOLD + Style.URL)
# you can do permutations, for example, you only need style only then
cprint('...', style=Style.BOLD)
# combine with normal text
print('123' + cprint('...', '#ff0000', pf=False) + '~~~')
Demo
★Click me to see the HTML which is converted from ipynb
Contributing
If you want to contribute, please use the release branch as the stable branch. dev is the future branch for the maintainer.
Be sure to write tests for new features. If you have any difficulties, you can ask me or discuss with me. I am glad if you want to join us.
By the way, I’m very friendly! (You can ask me questions with Chinese)
Useful Reference
The below link may help you to understand how do you write, such as this library by yourself.
More
See the documentation
Metadata
Release files for console-color 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| console_color-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / console_color-0.1.0-py3-none-any.whl
| Download URL | console_color-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c467cc76797b4fdab87927d19055fbde4c639b0ef814c80abeaf8b2eb7cf51f
|
|
BLAKE2b-256 checksum How to use checksums |
7710ef628d25438b1c6b8312bcb4c292cd7026fcd6ede4f9fc0b8133a0380c33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|