프로그래밍/Python
[python] simple-colors
홍반장水_
2023. 6. 9. 13:23
반응형
simple-colors
https://pypi.org/project/simple-colors/
simple-colors
Colorful output in terminal
pypi.org
#Colored Output in Python
import simple_colors
text = "Welcome to Python"
# Colored text
colored = simple_colors.blue(text)
print('Colored:', colored)
# Colored and Bold text
bold_colored = simple_colors.green(text,'bold')
print('BOLD:', bold_colored)
# Colored, Bold and Underlined text
attributes = ['bold','underlined']
bold_underlined = simple_colors.red(text, attributes)
print('BOLD and Underlined: ', bold_underlined)
Project description
Simple Colors
Colorful output in terminal.
Installation
pip install simple-colors
Usage
from simple_colors import *
print(green('hello'))
print(green('hello', 'bold'))
print(green('hello', ['bold', 'underlined']))
Inlucded colors
- black
- red
- green
- yellow
- blue
- magenta
- cyan
Included styles:
- bold
- bright
- dim
- italic
- underlined
- blink
- reverse
반응형