Skip to main content

Can it be used to print in color.

Project description

Color Print

PyPI version PyPI CodeFactor PyPI

Install

pip install colorful_print

Usage 1

import sys
from colorful_print import color

a = [1, 'a', 2.3]
b = (4, 'b', 5.6)

color.black('Print Black', a, b)
color.red('Print Red', a, b)
color.green('Print Green', a, b)
color.yellow('Print Yellow', a, b)
color.blue('Print Blue', a, b)
color.magenta('Print Magenta', a, b)
color.cyan('Print Cyan', a, b)
color.white('Print White', a, b)
sys.stdout.write("\n")

color.red('Print Red', a, b)
color.green('Print Bold Green', a, b, bold=True)
color.yellow('Print Bold Italic Yellow', a, b, bold=True, italic=True)
color.blue('Print Bold Italic Underline Blue', a, b, bold=True, italic=True, underline=True)
color.magenta('Print Bold Italic Underline StrikeOut Magenta', a, b, bold=True, italic=True, underline=True, strike_out=True)
color.cyan('Print Bold Italic Underline Reverse Cyan', a, b, bold=True, italic=True, underline=True, reverse=True)
color.white('Print Bold Italic Underline StrikeOut Reverse White', a, b, bold=True, italic=True, underline=True, strike_out=True, reverse=True)
sys.stdout.write("\n")

color.black('Print Black', a, b, sep='\t\t', end='\n\n', flush=True)
color.red('Print Red', a, b, sep='\t\t', end='\n\n', flush=True)
color.green('Print Green', a, b, sep='\t\t', end='\n\n', flush=True)

Usage 2

from colorful_print import color

def colorful_dispatcher(c: str, msg: str, *args, **kwargs):
    dispatch = getattr(color, c)
    dispatch(msg, *args, **kwargs)

def red(msg: str, *args, **kwargs):
    colorful_dispatcher('red', msg, *args, **kwargs)

def yellow(msg: str, *args, **kwargs):
    colorful_dispatcher('yellow', msg, *args, **kwargs)

red('123', 456, italic=True)
yellow('789', 123.456, italic=True, bold=True)

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

colorful-print-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

colorful_print-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file colorful-print-0.1.0.tar.gz.

File metadata

  • Download URL: colorful-print-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for colorful-print-0.1.0.tar.gz
Algorithm Hash digest
SHA256 040bea59d79777870195f3f158b1049b960b31555aa877b790c225820ac47a61
MD5 7b4ec060c3b96cf04bf81a383ff2c3c6
BLAKE2b-256 7553c66984286a9014b7eeb13eeb638206a4c54ca32ac91be84c0170d8d9c4c4

See more details on using hashes here.

File details

Details for the file colorful_print-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for colorful_print-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cd4c278c517106d118eb92d9849926e3cb885361795925ec002b40edea7f394
MD5 f3a3ad9eff0f4823857180e5c91edf5a
BLAKE2b-256 e02fc2fd74235f4952fbf5ab27d9d8dac717e76ac59f83be2de9af2e888c5216

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