Skip to content

c.py

Module for holding colour code values.

c(colour, text)

Return coloured text.

Source code in mps_youtube/c.py
def c(colour, text):
    """ Return coloured text. """
    colours = {'r': r, 'g': g, 'y': y, 'b':b, 'p':p}
    return colours[colour] + text + w

charcount(s)

Return number of characters in string, with ANSI color codes excluded.

Source code in mps_youtube/c.py
def charcount(s):
    """ Return number of characters in string, with ANSI color codes excluded. """
    return len(ansirx.sub('', s))