Skip to content

Instantly share code, notes, and snippets.

import os
import subprocess
class Colorcodes(object):
"""
Provides ANSI terminal color codes which are gathered via the ``tput``
utility. That way, they are portable. Color codes are initialized to
empty strings. If the output is being redirected or if there occurs
any error with ``tput``, keep empty strings.