你自己的表现力画家谁的颜色文字在你的终端。

painter的Python项目详细描述


Build StatusCoverage StatusLicenseLatest VersionDownloads

Painter Logo

painter是基于 chalkcolors.js node.js的库。然而,painter试图提供 读起来像英语的表达性api。

油漆工经过全面测试,覆盖率100%,并且完全剥落8 也很顺从!

快速启动

在您的virtualenv中安装painter,如下所示:

pip install painter

现在,使用它向终端输出颜色:

from__future__importprint_functionfrompainterimportpaint# Simple printing of colorsprint('Welcome to Painter!',paint.red('I can paint things red'),paint.blue('and blue'))# Chaining colors and stylesprint(paint.blue.on_red.bold.underline('and far more complex combos too'))print()# Using color patternsprint(paint.rainbow('Awww look, a pretty rainbow :)'))print(paint.zebra('and a scary looking zebra!'))print()# Nested paintingprint(paint.on_red('I can also use a background color across',paint.blue('multiple'),paint.yellow('foreground colors')))# Custom separatorprint(paint('and','allow','you to use',paint.red('custom separators'),sep='-'))print()# Creating themescool_theme=paint.green.on_red.underline.boldprint('Creating',cool_theme('your own theme'),'is easy')# Easily disable painting of colorspaint.enabled=Falseprint('and I allow you to easily',paint.red('disable'),paint.blue('me'))print()paint.enabled=Trueprint('Hope you have a',paint.blue('lovely day!'),paint.green(':)'))

此脚本的输出如下:

Painter Demo

文档

有关使用painter的详细信息,请查看 Painter GitHub Page

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java创建猜谜游戏程序   JavaWebSocketContainer。connectToServer似乎挂起了   如何在java中中断函数   java c#socket client multiple BeginSend()未到达服务器   不可见的组件然后在Java中的窗格之间切换   java在应用程序类中使用静态接口安全吗?   java等待函数完成,直到回调到来   使用DataOutputStream时的java新行,Android   java服务对象的定义是什么?   基于视图的javahibernate复合密钥   java将varchar连接到char在JPA(oracle)中不起作用   如何在java中通过point类读取多个点?