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

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根据选择随机设置图标   java如何将Android Studio与本地服务器数据库SQL server 2008连接?   java在点击鼠标后绘制一个椭圆形   java选项窗格相对于其父项的位置   java如何在Android中的switch case中使用String[]输入?   安卓无法从“15.0.1”确定java版本   如果满足特定条件,java是否重置计时器?   java是一个实体类,可以在OOAD中返回其他实体实例吗?   bash将对jar文件| cut | awk和java程序的调用集成到一个统一进程中   Spring安全更新身份验证成功时的最后登录日期   数据库身份验证中基于Java控制台的客户端服务器登录应用程序错误   java Selenium junit测试失败,驱动程序过早获取URL   java LibGdx多点触摸事件混淆   带扫描仪的java打印空间   来自旧版应用程序的java springcloudsleuth头   java如何实现模板设计模式?   java如何比较具有多个值的键的两个映射?   读取时R中的java MemoryError。xlsx