Skip to main content

Display colored text in the terminal

Project description

colort

终端中的彩色显示

使用

安装

pip install colort

使用

from colort import display_style as ds

src = "这是要显示的文本"
dist = ds.format_with_one_style(src, ds.foreground_color.red)
print("更改文字颜色:", dist)
dist = ds.format_with_one_style(src, ds.backgorud_color.green)
print("更改文字背景色:", dist)
dist = ds.format_with_multiple_styles(src, ds.foreground_color.red, ds.mode.underline, ds.mode.bold)
print("多种样式:", dist)

效果:

sample

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for colort, version 0.4
Filename, size File type Python version Upload date Hashes
Filename, size colort-0.4-py3-none-any.whl (3.9 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page