반응형
simple-colors
https://pypi.org/project/simple-colors/
#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
반응형
'프로그래밍 > Python' 카테고리의 다른 글
[python] iPad에서 파이썬 하기 (0) | 2023.07.04 |
---|---|
[python] pandas get started (0) | 2023.06.11 |
공학자를 위한 Python (0) | 2023.06.04 |
[python] 스파이더, https://www.spyder-ide.org/ (0) | 2023.06.04 |
[python] 파이썬 식별자(Identifiers) (0) | 2023.05.31 |