答案 0 :(得分:1)
要打印ASCII艺术字,您应该查看pyfiglet库
https://github.com/pwaller/pyfiglet
要获得所需的效果,可以使用以下简单脚本:
import os
import time
from pyfiglet import Figlet
f = Figlet(font='slant')
word = 'HELLO'
curr_word = ''
for char in word:
os.system('reset') #assuming the platform is linux, clears the screen
curr_word += char;
print f.renderText(curr_word)
time.sleep(1)
(注意:我没有测试过脚本,但概念应该是正确的)
答案 1 :(得分:0)
另一个ASCII艺术python软件包:
https://github.com/sepandhaghighi/art
ART是一个Python库,用于将文本转换为ASCII艺术风格。 ;-)
>>> tprint("art") # print ASCII text (default font)
_
__ _ _ __ | |_
/ _` || '__|| __|
| (_| || | | |_
\__,_||_| \__|