Skip to main content

一个用于在终端中打印彩色文字的包

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.")

展示

效果展示1

效果展示2

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

colorprintconsole-1.0.8.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

colorprintconsole-1.0.8-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

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

Hashes for colorprintconsole-1.0.8.tar.gz
Algorithm Hash digest
SHA256 f2d323e3f45d9b44620cf85d27faddcc87de953b669306860ac59d10cca43eb4
MD5 6e515ed5b2bb38f6bf813e26d1c65dd3
BLAKE2b-256 40af504b8cb1323e16abe43c574e431c50b73128521a31fd954305f85c99d726

See more details on using hashes here.

File details

Details for the file colorprintconsole-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for colorprintconsole-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0338d01af598678ae5bf32ea7e878a6daa0a6e84f5ffe64d9336939170d43901
MD5 7be4b3e892da9db32432ecc85f900fd8
BLAKE2b-256 cf5a0b76f3b6f8fb587164c85cb819af39f5656d17c088997a10dbd59ff453ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page