Skip to main content

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

https://raw.githubusercontent.com/CarsonSlovoka/console-color/release/doc/_static/nav_bar.logo.png

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

console_color-0.1.0-py3-none-any.whl (13.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page