Пример #1
0
def warning(s):
    short, rgb = colorhelper.rgb2short('d78700')
    sys.stdout.write('\033[38;5;%smWarning: \033[0m%s\n' % (short, s))
Пример #2
0
#! /usr/bin/env python
import colorhelper
import sys

if __name__ == '__main__':
    short, rgb = colorhelper.rgb2short(sys.argv[1])
    code = '\\[\\033[38;5;%sm\\]' % (short)
    sys.stdout.write(code)
Пример #3
0
def error(s):
    short, rgb = colorhelper.rgb2short('FF0000')
    sys.stdout.write('\033[38;5;%smError: \033[0m%s\n' % (short, s))