一个用于在终端中打印彩色文字的包
Project description
简介
- 在控制台中用于彩色打印的包
- 采用的是亮色
- 支持多值打印
- 支持使用十六进制颜色值(如
"FF00FF"或"#00FF00")打印对应颜色的文字
安装
pip install --index-url https://pypi.org/simple colorPrintConsole -U
使用
from colorPrintConsole import ColorPrint, cp
# 推荐用法1:直接用 ColorPrint 类
cp1 = ColorPrint()
cp1.red("This is red.")
cp1.green("This is green.")
cp1.yellow("This is yellow.")
cp1.blue("This is blue.")
cp1.magenta("This is magenta.")
cp1.cyan("This is cyan.")
cp1.red("123", "456", "789") # 多值打印
cp1.color_hex("FFC0CB", "This is pink.") # 自定义十六进制颜色值
cp1.color_hex("#800080", "This is purple.") # 自定义十六进制颜色值
# 推荐用法2:直接用 cp 单例对象
cp.red("This is red.")
cp.green("This is green.")
cp.yellow("This is yellow.")
cp.blue("This is blue.")
cp.magenta("This is magenta.")
cp.cyan("This is cyan.")
cp.color_hex("FFC0CB", "This is pink.")
cp.color_hex("#800080", "This is purple.")
展示
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file colorprintconsole-1.0.8.tar.gz.
File metadata
- Download URL: colorprintconsole-1.0.8.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2d323e3f45d9b44620cf85d27faddcc87de953b669306860ac59d10cca43eb4
|
|
| MD5 |
6e515ed5b2bb38f6bf813e26d1c65dd3
|
|
| BLAKE2b-256 |
40af504b8cb1323e16abe43c574e431c50b73128521a31fd954305f85c99d726
|
File details
Details for the file colorprintconsole-1.0.8-py3-none-any.whl.
File metadata
- Download URL: colorprintconsole-1.0.8-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0338d01af598678ae5bf32ea7e878a6daa0a6e84f5ffe64d9336939170d43901
|
|
| MD5 |
7be4b3e892da9db32432ecc85f900fd8
|
|
| BLAKE2b-256 |
cf5a0b76f3b6f8fb587164c85cb819af39f5656d17c088997a10dbd59ff453ef
|