Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A small package for printing colored strings

Project description

colorP

This package is a small and simple utility for printing colored strings on consoles. colorP supports 9 different formatting styles and several foreground and background colors!

You can install it by issuing the following command on a UNIX terminal:

sudo pip install -i colorp

Usage:

Methods :-

pPrint(args,text,br=?):

  • args: is a dictionary object, which needs atleast one of s,fg or bg defined with the corresponding values as strings.
args = {'s':'bold','fg':'red','bg':'white'}
  • text: is the string to be printed with the given styling
  • br: [OPTIONAL ARGUMENT: default value= True], can set it to False if you need no linebreak after ouput.

Eg():

  • prints out examples of a few colors and styles for user visualization.

Styling and Formatting:

  • The args object decides how the text will be formatted. Each key in args can be one of certain pre-defined values. They are listed below:
  • 's': Text style
Value Description
'plain' Formats the text as plain text
'bold' Bolds the text
'dim' Dims the text
'italic' Italicizes the text
'underline' Underlines the text
'blink' Blinks the text repeatedly
'reverse' Swaps foreground and background values
'hidden' Hides the text on display
'striked' Strikes off the desired text
  • 'fg': Font color
Value
'black'
'red'
'green'
'yellow'
'blue'
'magenta'
'cyan'
'lightgray'
'darkgray'
lightred'
'lightgreen'
'lightyellow'
'lightblue'
'lightmagenta'
'lightcyan'
'white'
'default'
  • 'bg': Background color
Value
'black'
'red'
'green'
'yellow'
'blue'
'magenta'
'cyan'
'lightgray'
'darkgray'
lightred'
'lightgreen'
'lightyellow'
'lightblue'
'lightmagenta'
'lightcyan'
'white'
'default'
NOTE:
  • 'bg' has the same possible values as 'fg'.

Project details


Release history Release notifications

Download files

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

Files for colorp, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size colorp-0.0.1-py3-none-any.whl (3.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size colorp-0.0.1.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page