Skip to main content

在终端有颜色地打印python变量

Project description

colorama-terminal

在终端有颜色地打印python变量。

使用

带颜色的字符串 Colormsg

import colorama_terminal as ct

# 打印紫色的你好
hello = ct.Colormsg("helloworld").set_color('MAGENTA')
print(hello)

# 打印复杂的数据
raw_colormsg = ct.Colormsg.from_built_in_type([{1: True}, {"2": False}])
print(raw_colormsg)

# 打印复杂的数据
ct.print([{1: True}, {"2": False}])

其他功能 proportion_bar shell 函数

from colorama_terminal import * #内置的print被覆盖了
# 进度条
import time
for i in range(0, 101):
    time.sleep(0.02)
    proportion_bar(i / 100, 'MAGENTA')
print('\nOK')

# 进入交互式
shell()

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

colorama_terminal-0.0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file colorama_terminal-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for colorama_terminal-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca715e343a2bc69cbfaf7dec45761df6656bf124450aa301953f5569f693de8b
MD5 f6f10c0a5af19be4c1661d3b6c182b3f
BLAKE2b-256 8fdac058151790c36bfcf89dd31ae78b577d760425b5ffa1086f4d3a663aec68

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