Skip to main content

Colored your text

Project description

Colored console

A simple module based on c++ and bind with a python for a colored console.
Main page on github


  • Compiled with gcc.

  • Ansi will enable automatically!

  • Not support all consoles!


Simply import with:

import colorcon


This module contains some defaults as says:

Colors in class COLORS:

  1. 'black' or COLORS.Black
  2. 'white' or COLORS.White
  3. 'red' or COLORS.Red
  4. 'yellow' or COLORS.Yellow
  5. 'green' or COLORS.Green
  6. 'blue' or
  7. 'purple' or COLORS.Purple
  8. 'orange' or COLORS.Orange

Modes in class MODES:

  1. 'bold' or COLORS.Black

  2. 'light' or COLORS.White

  3. 'italic' or COLORS.Red

  4. 'underline' or COLORS.Yellow

    Note: these aren't supported on all consoles

  5. 'slowblink' or COLORS.Green

  6. 'rapidblick' or

  7. 'reverse' or COLORS.Purple



Can customize your texts!


  • For colored text use:

    colorcon.colored('im colored(with red bg and white fg)!', 'red', COLORS.White)

    or you can create your custom color:

    colorcon.colored('im rgb', [1, 2, 3])
  • You can add modes to output:

    colored.colored("i'm bold and i have undeline", modes=['bold', MODES.Underline])

    or you can simply mix modes like:\

    mode = MODES.bold | MODES.Underline


Can set color for background!


  • Console will not reset(The color will be available)


  • Set background color to red

    colorcon.set_background('red')  # set background color red
    colorcon.set_background([255, 0, 0])  # set background color with rgb

    Then print some text that are red

    colorcon.output('iam red')


Same as colorcon.set_background but adjust foreground!


Will reset console(Colors was set will be reset)


same as python print, But it always flushes stdout after every print!

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

colorcon-0.1.3.tar.gz (39.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page