0%

轻量终端打印工具:wasabi


可以用于终端打印一些信息

安装

1
pip install wasabi

代码以及对应的执行效果

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from wasabi import Printer

msg = Printer()
msg.text("Hello world!")

msg.good("Success")
msg.fail("Error")
msg.warn("Warning")
msg.info("Info")

msg.divider("Heading",char='-')

import time
with msg.loading("Loading..."):
# Do something here that takes longer
time.sleep(3)
msg.good("Successfully loaded something!")

from wasabi import color

formatted = color("This is a text", fg="white", bg="green", bold=True)
print(formatted)

from wasabi import wrap

wrapped = wrap("Hello world, this is a text.", indent=2)
print(wrapped)

支持一根棒棒糖!