Member-only story

Printing in Color with Python

Chris Doucette
2 min readDec 7, 2018

Introduction

Today I wanted to show you multiple ways that you are able to have your console output be colored in your Python scripts.

Termcolor

The first module we’ll explore is termcolor. Termcolor allows you to use ANSI color formatting with your console output. To install termcolor you run:

$ pip install termcolor

Once termcolor is installed you can use it to color your output:

Colorama

The next module we will be looking at is colorama. Colorama is a really convenient module that allows us to color our output using ANSI codes across all platforms. To install colorama you run:

$ pip install colorama

Here is an example of colorama in action:

--

--

Chris Doucette
Chris Doucette

Written by Chris Doucette

Cybersecurity Analyst and Finance Enthusiast

No responses yet