控制台的性感字体

python-cfonts的Python项目详细描述


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

Build Status

这是cfonts的python端口。感谢原始代码和漂亮的控制台字体!

NOTE: This project supports Python 2.7+ and 3.4+

安装

$ pip install python-cfonts

用法

Documentation

命令行界面:

$ cfonts --help
Usage: cfonts [OPTIONS] TEXT

  This is a tool for sexy fonts in the console. Give your cli some love.

Options:
  --version                       Show the version and exit.
  -m, --max-length INTEGER        Use to define the amount of maximum
                                  characters per line
  -s, --spaceless                 Use to disable the padding around your
                                  output
  -z, --line-height INTEGER       Use to define your line height
  -l, --letter-spacing INTEGER    Use to define your letter spacing
  -a, --align [left|center|right]
                                  Use to align your text output
  -b, --background [transparent|black|red|green|yellow|blue|magenta|cyan|white|bright_black|bright_red|bright_green|bright_yellow|bright_blue|bright_magenta|bright_cyan|bright_white]
                                  Use to define the background color
  -c, --colors TEXT               Use to define the font color
  -f, --font [console|block|simpleBlock|simple|3d|simple3d|chrome|huge]
                                  Use to define the font face
  --help                          Show this message and exit.

或者实际生成字体:

fromcfontsimportrender,sayoutput=render('Hello world',colors=['red','yellow'],align='center')print(output)

支持的字符

^{}^{}^{}^{}^{}
^{}^{}^{}^{}^{}
^{}^{}^{}^{}^{}
^{}^{}^{}^{}^{}
^{}^{}^{}^{}^{}
^{}^{}^{}^{}^{}
^{}^{}^{}^{}^{}
^{}^{}^{}^{}^{}
^{}^{}^{}^{}^{}
^{}^{}^{}^{}^{}
^{}^{}^{}^{}^{}
^{}^{}^{}^{}^{}
^{}^{}^{}^{}^{}
^{}^{}^{}^{} (space)

测试

$ pipenv run pytest

许可证

该项目由@dominikwilkowski根据gplv2许可证发起。 由@frostming根据gplv2许可证进行移植。有关详细信息,请参见LICENSE

更改日志

  • v0.3.1修复一个后台没有覆盖整个宽度的错误。
  • v0.3.0支持python 2.7。
  • v0.2.0初始提交和测试。

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

推荐PyPI第三方库


热门话题
GridLayout不工作的java问题   java Restlet请求对象不包含身份验证信息   java使用Cucumber为每个正在运行的线程创建一个TestNG runner类   java在平面文件中存储并跟踪它们?   类Lcom/google/firebase/FirebaseApp中没有虚拟方法zzbzo()Z;或者它的超类   java如何在安卓中创建字符串模式   可从Java访问的树莓PI传感器   java 50+GB分隔文件中的大致行数   是否有Java进程内数据库,允许从多表虚拟机访问?   当我使用ArrayList时,HashMap中的Java ArrayList会导致HashMap中的数据被删除。去除   如何将值存储在最佳java集合结构中   java消息Servlet。servlet appServlet的init()引发异常   java正在使用Spring引导生成空日志文件   c#在访问实例变量时使用this关键字是否更有效?   java JScrollPane滚动到最后添加的行   java Vertx抛出IllegalStateException:响应已被写入   java Liferay以编程方式更改portlet列   java下载单个s3对象并将它们合并到单个文件中   java spark数据帧将JSON转换为ORC满足“列模糊异常”