print with color on the console.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file console_color-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: console_color-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c467cc76797b4fdab87927d19055fbde4c639b0ef814c80abeaf8b2eb7cf51f |
|
MD5 | f2397acc8e18e5a3e422ae8902005391 |
|
BLAKE2b-256 | 7710ef628d25438b1c6b8312bcb4c292cd7026fcd6ede4f9fc0b8133a0380c33 |