可以用于终端打印一些信息
安装
代码语言:javascript复制pip install wasabi
代码以及对应的执行效果
代码语言:javascript复制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)