端子串样式
style的Python项目详细描述
style是一个简单的终端字符串样式包。它的api是 chalkjavascript包。
安装
$ pip install style
用法
importstyleprint(style.red('Hello',style.bold('world')+'!'))
API
样式style*[.style](*objects, sep=' ')
链styles并将最后一个作为带参数的方法调用。顺序无关紧要,以后的款式 发生冲突时优先,例如style.red.yellow.green等同于style.green。样式可以 嵌套。
默认情况下,多个参数将由一个空格sep分隔。
样式enabled
颜色支持是自动检测的,但也可以手动更改。
- 将style.enabled设置为True或False
- 使用命令行参数--color或--no-color
样式
Modifiers | Colors | Background colors | ||
---|---|---|---|---|
|
|
|
|
|