ASCII字符绘图网站推荐及使用Python绘制ASCII字符画
文字显示为ASCII字符画:图片显示为ASCII字符画:https://tool.lu/asciipainting/category.html 和上一个网站类似提供各种ASCII 字符画http://life.chacuo.net/convertphoto2char还不错https://www.qtool.net/imgasciivscode插件:koroFileHeader: https://g
ASCII字符绘图网站推荐及使用Python绘制ASCII字符画
推荐网站:
文字显示为ASCII字符画:
- 🌟http://patorjk.com/software/taag/# 可以一键生成多种字体格式预览,方便选择
- http://www.network-science.de/ascii/ 比较一般
- http://life.chacuo.net/convertfont2char 支持汉字
- https://wow.techbrood.com/fiddle/40897 前端动画网站
图片显示为ASCII字符画:
- 🌟https://www.degraeve.com/img2txt.php 网站还有其他功能可用
- https://asciiart.website/index.php 一个ascii art 收集网站,不能上传图片制作,如:
_
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
.' \\| |// `.
/ \\||| : |||// \
/ _||||| -:- |||||_ \
| | \\\ - /'| | |
| \_| `\`---'// |_/ |
\ .-\__ `-. -'__/-. /
___`. .' /--.--\ `. .'___
."" '< `.___\_<|>_/___.' _> \"".
| | : `- \`. ;`. _/; .'/ / .' ; |
\ \ `-. \_\_`. _.'_/_/ -' _.' /
===========`-.`___`-.__\ \___ /__.-'_.'_.-'================
`=--=-'
- https://tool.lu/asciipainting/category.html 和上一个网站类似提供各种ASCII 字符画
- http://life.chacuo.net/convertphoto2char 还不错
- https://www.qtool.net/imgascii
vscode插件:
koroFileHeader: https://github.com/OBKoro1/koro1FileHeader
用于一键生成文件头部注释并自动更新最后编辑人和编辑时间、函数注释自动生成和参数提取,同时提供几个预制的字符画。
Python库骚操作:
pyfiglet
:https://github.com/pwaller/pyfiglet
库中可供使用的各种字体可以查看:http://www.figlet.org/examples.html
from pyfiglet import Figlet
f = Figlet(font='slant')
text = f.renderText('Python')
print(text)
执行结果:
____ __ __
/ __ \__ __/ /_/ /_ ____ ____
/ /_/ / / / / __/ __ \/ __ \/ __ \
/ ____/ /_/ / /_/ / / / /_/ / / / /
/_/ \__, /\__/_/ /_/\____/_/ /_/
/____/
同时可以配合 colorama
库为字符串上色:https://github.com/tartley/colorama
字体颜色 | 背景颜色 | 字体格式 | |
---|---|---|---|
名称 | Fore | Back | Style |
颜色 | BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET | BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET | DIM, NORMAL, BRIGHT, RESET_ALL |
注意:颜色都需要大写。
from pyfiglet import Figlet
from colorama import Fore
f = Figlet(font='slant')
text = f.renderText('Python')
print(Fore.GREEN + text)
不过需要注意的是,在windows上colorama不太好用,实测vscode、powershell和cmd中都不生效,不过PyCharm中可以使用。在Linux下使用效果正常。
此外还可以使用 rich
库代替 colorama :https://github.com/Textualize/rich/blob/master/README.cn.md
rich库的功能更加丰富,不仅可以对字符串上色还可以创建虚拟控制台,显示Emoji表情等。
from pyfiglet import Figlet
import rich
f = Figlet(font='slant')
text = f.renderText('Python')
rich.print(f'[red]{text}[/red]')
更多推荐
所有评论(0)