Print color on Linux or Windows terminals.
pip install pyclrs
from pyclrs.color import Use
c = Use('Hello World')
- black
c.backblack()
orc.foreblack
- red
c.backblack()
orc.foreblack
- green
c.backblack()
orc.foreblack
- yellow
c.backblack()
orc.foreblack
- blue
c.backblack()
orc.foreblack
- nagebta
c.backblack()
orc.foreblack
- cyan
c.backblack()
orc.foreblack
- white
c.backblack()
orc.foreblack
- default
c.default()
- highlight
c.highlight()
- underline
c.underline()
- twinkle
c.twinkle()
- hide
c.hide()
- excute
c.excute()
from pyclrs.color import Use
p1 = Use('Hello World')
print(p1.excute())
p2 = Use('Hello World')
p2.backred()
p2.foreblack()
print(p2.excute())
p3 = Use('Hello World')
p3.forered()
p3.twinkle()
print(p3.excute())
from pyclrs.color import Use
title = Use('%-17s%-10s%-10s'%("Ipaddr","Server","Status"))
title.backcyan()
title.foreblack()
redis = Use('%-10s'%'Started')
redis.backwhite()
redis.foregreen()
mysql = Use('%-10s'%'Stopped')
mysql.backwhite()
mysql.forered()
mysql.twinkle()
httpd = Use('%-10s'%'Unknown')
httpd.backwhite()
httpd.foreyellow()
addr1 = Use('%-17s%-10s'%('192.168.100.100','redis'))
addr1.backwhite()
addr1.foreblack()
addr2 = Use('%-17s%-10s'%('192.168.100.101','mysql'))
addr2.backwhite()
addr2.foreblack()
addr3 = Use('%-17s%-10s'%('192.168.100.102','httpd'))
addr3.backwhite()
addr3.foreblack()
print(title.excute())
print(addr1.excute()+redis.excute())
print(addr1.excute()+mysql.excute())
print(addr1.excute()+httpd.excute())