Skip to main content

Color text and background of terminal output

Project description

Colorise Terminal

This package allows you to change the text color, background color and bold of the terminal output.

To use it, you only need to import one function

from colorise_terminal import cprint

cprint have the same parameters than the regular print functions, but adds 3 more: text_color, bg_color and bold

  • text_color: Color of the text to print, it could be in hex string format: '#FFAA00' ; or in RGB tuple of integer format: (255, 170, 0). Defaults to None.

  • bg_color : Color of the text background, it could be in hex string format:'#22CC33' ;or in RGB tuple of integer format: (34, 204, 51). Defaults to None.

  • bold (bool): Text in bold format. Defaults to False.

These are all optional paramaters, so if you omit all of them cprint will behave as regular print.

Here are some examples of the function working in a terminal session:

test

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

colorise_terminal-0.1.2.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

colorise_terminal-0.1.2-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

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