Did I find the right examples for you? yes no

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)

        def colored_print(text, fg_colour=None, bg_colour=None):
    try:
        if len(text) == 0:
            return ''
        if isinstance(text, (str, unicode)):
            pass
        elif len(text) == 1:
            text = text[0]
        else:
            text = "[" + ", ".join(text) + "]"
    except TypeError:
        pass

    if not fg_colour and not bg_colour:
        return text
    if not fg_colour:
        return format_colour('$BG-' + bg_colour.upper() + text + "$RESET", True)
    if not bg_colour:
        return format_colour('$' + fg_colour.upper() + text + "$RESET", True)

    return format_colour('$BG-' + bg_colour.upper() + '$' + fg_colour.upper() + text + "$RESET", True)
        


src/d/i/Dialogs-0.13/src/dialogs/sentence_factory.py   Dialogs(Download)
import random
 
from helpers.helpers import colored_print
from helpers.printers import level_marker
from resources_manager import ResourcePool