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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file colorise_terminal-0.1.2.tar.gz.

File metadata

  • Download URL: colorise_terminal-0.1.2.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for colorise_terminal-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8f1ba15ded7a92e3459d04c7982e0c1eaacace7081eb12bc6887d368e7d43f63
MD5 e6bcf1d69ffd37bb4dc0dc1b3bd6b65a
BLAKE2b-256 e240fb476fb675aa094cd28f3a51c459e516d6e2055c32efe560ae955f9be13a

See more details on using hashes here.

File details

Details for the file colorise_terminal-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for colorise_terminal-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 314893aa3d0d4132b70b24718ae58d6f429b3ff6da9ef3fd3065df7fe41d6491
MD5 72367573cbb09cb993bd23d279e79fdf
BLAKE2b-256 352ced4cd0a85aa9b538aae9c98fe5a35140f610b32fdd2f1f707e7e8a1f75b9

See more details on using hashes here.

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