生成艺术ASCII文本

xart的Python项目详细描述


xart是一个纯python库,它提供了一种简单的方法来生成 艺术ascii文本。人生苦短,冷静点。

██╗  ██╗ █████╗ ██████╗ ████████╗
╚██╗██╔╝██╔══██╗██╔══██╗╚══██╔══╝
 ╚███╔╝ ███████║██████╔╝   ██║
 ██╔██╗ ██╔══██║██╔══██╗   ██║
██╔╝ ██╗██║  ██║██║  ██║   ██║
╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝

###开始

帮助

$ xart -h
usage: __init__.py [-h] [-f FONT] [-c COLOR] [-i] [-s] [-l] [-v]

xart : generate art ascii texts.

optional arguments:
  -h, --help            show this help message and exit
  -f FONT, --font FONT  font to render with, default random
  -c COLOR, --color COLOR
                        font color, default WHITE, all : BLACK, RED, GREEN,
                        YELLOW, BLUE, PURPLE, CYAN, GRAY, WHITE
  -i, --info            show information of given font
  -s, --show            show random fonts
  -l, --list            list all supported fonts
  -v, --version         version

通过随机字体生成ascii文本

$ xart test
    ███        ▄████████    ▄████████     ███
▀█████████▄   ███    ███   ███    ███ ▀█████████▄
   ▀███▀▀██   ███    █▀    ███    █▀     ▀███▀▀██
    ███   ▀  ▄███▄▄▄       ███            ███   ▀
    ███     ▀▀███▀▀▀     ▀███████████     ███
    ███       ███    █▄           ███     ███
    ███       ███    ███    ▄█    ███     ███
   ▄████▀     ██████████  ▄████████▀     ▄████▀

通过给定字体生成ascii文本

$ xart test -f 3D_Diagonal

    ___                                 ___
  ,--.'|_                             ,--.'|_
  |  | :,'                            |  | :,'
  :  : ' :               .--.--.      :  : ' :
.;__,'  /      ,---.    /  /    '   .;__,'  /
|  |   |      /     \  |  :  /`./   |  |   |
:__,'| :     /    /  | |  :  ;_     :__,'| :
  '  : |__  .    ' / |  \  \    `.    '  : |__
  |  | '.'| '   ;   /|   `----.   \   |  | '.'|
  ;  :    ; '   |  / |  /  /`--'  /   ;  :    ;
  |  ,   /  |   :    | '--'.     /    |  ,   /
   ---`-'    \   \  /    `--'---'      ---`-'
              `----'

通过给定颜色生成ascii文本

COLOR

颜色

显示所有支持的字体

$ xart -l
xart : generate art ascii texts.

  0. 1Row
  1. 3-D
  ...
  277. Wow

All 278 fonts.

显示字体信息

$ xart -i -f Weird
weird.flf (version 2)
by:  Bas Meijer   meijer@info.win.tue.nl   bas@damek.kth.se
fixed by: Ryan Youck   youck@cs.uregina.ca
some special characters '#%*' etc. are not matching, they are from other fonts.
Explanation of first line:
flf2 - "magic number" for file identification
a    - should always be `a', for now
$    - the "hardblank" -- prints as a blank, but can't be smushed
6    - height of a character
5    - height of a character, not including descenders
20   - max line length (excluding comment lines) + a fudge factor
15   - default smushmode for this font (like "-m 15" on command line)
13   - number of comment lines

版本

$ xart -v
xart : generate art ascii fonts, version 0.1.5.
  ___      ____       ___
 / _ \    (___ \     / _ \
| | | |     __) )   | | | |
| | | |    / __/    | | | |
| |_| | _ | |___  _ | |_| |
 \___/ (_)|_____)(_) \___/

###安装

xart托管在PYPI和 可以这样安装:

$ pip install xart

或者,您也可以从 GitHub并手动安装:

$ git clone git@github.com:xlzd/xart.git
$ cd xart
$ python setup.py install

更新信息:

$ pip install xart --upgrade

###许可证

wtfpl(here

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

推荐PyPI第三方库


热门话题
java我应该关闭tcp连接吗?   java指定初始化一个有引用和没有引用的类之间的区别   Java JSON反序列化错误   java将InputStream插入PostgreSQL   java Android屏幕在活动启动时取消伪装   java两个字符串实例看起来相同,但它们的哈希代码不同   java如何创建**数字**而不是字符串的数组列表?   java我可以确定由正则表达式模式匹配的第一个字符集吗?   java以编程方式更改日期范围的日期格式   java Hibernate在加载时填充自动连接字段   java如何使两个不相关的实体(两个存储库)同时在一个项目中运行?可能吗?   使用singlechildevent检索java Firebase数据   在安卓中尝试动态添加片段时未找到java ID   在HTML中编码Java GB2312字符串无法正确显示   java在缓慢的消费卡夫卡上处理背压并避免重新平衡   由hibernate生成的java查询过于冗长