Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _wrap_with(code):
- def inner(text, bold=False):
- c = code
- if bold:
- c = "1;%s" % c
- return "\033[%sm%s\033[0m" % (c, text)
- return inner
- red = _wrap_with('31')
- green = _wrap_with('32')
- yellow = _wrap_with('33')
- blue = _wrap_with('34')
- magenta = _wrap_with('35')
- cyan = _wrap_with('36')
- white = _wrap_with('37')
- """
- usage
- include the function and the code of the color you will be using
- red = _wrap_with('31')
- blue = _wrap_with('34')
- print red('Some text'),"tits",blue('Some more text')
- """
Advertisement
Add Comment
Please, Sign In to add comment