How to use the zdict.utils.Color.print function in zdict

To help you get started, we’ve selected a few zdict examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zdict / zdict / zdict / easter_eggs.py View on Github external
def show_pyjoke(record: Record):
    if not record:
        return

    for i, s in enumerate(
        re.split(r'\b({})\b'.format(record.word), record.content)
    ):
        Color.print(
            s,
            'lindigo' if i % 2 else 'indigo',
            end=''
        )

    print('\n\n', end='')
github zdict / zdict / zdict / easter_eggs.py View on Github external
def lookup_pyjokes(word: str):
    pyjokes = import_pyjokes_module()

    if not pyjokes:
        return

    record = get_pyjoke(pyjokes, word)
    if record:
        Color.print('[pyjokes]', 'blue')
        show_pyjoke(record)