Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

huseyin/color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

color colorize CocoaPods Build Status

String colorize module for Python 3.x

Color chart

chart

Installation

$ pip install color

or

$ easy_install color

or make it

$ python setup.py install

Usage

# -*- coding: utf-8 -*-
#
# You use to specific functions
#
# from color import colorize
# from color import uncolorize

from color import *

# colorize function. set the other code.
print(colorize(38, 5, 197, 'foo bar baz'))

# uncolorize function
print(uncolorize(red('foo')))

# tr function.
print(tr('foo bar baz', 'o', FgColor.Red))      # colorized: 'o' chars.
print(tr('foo bar baz', 'foo', FgColor.Yellow)) # colorized: 'foo' words.

# tr_iter function.
print(tr_iter('foo bar baz', 'oa', FgColor.Green)) # colorized: all of 'o' and 'a' chars.

# cprint function.
cprint('hellooo', base=Base.Bold)
cprint('foo bar', fg=FgColor.Red, file=sys.stderr)
cprint('foo') # Stdout

# OTHERS
r = red('ops!')
g = green('hmmm...')
cprint(r, g)

cprint_yellow('yooo!!!')
cprint_green('success')
cprint_black('cocoa bitter')

# ...

Credits

License

The MIT License (MIT) - see LICENSE for more details

About

String colorize module for Python 3.x

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published