Python Art – Text to ASCII art

In this post we will convert text to ASCII art in Python, to do this we will be using the Art library in Python used to convert text to ASCII art. ASCII art sometimes also referred to as computer text art is the creation of graphics or art using ASCII text characters.

See the sample of Python code below where we use the library to convert text. The project utilizes a while loop and will return an unlimited number of ASCII art.

from art import *

while True:
        user_input=input("Enter text to convert to art: ")
        print(text2art(user_input))

Some example output for the above can be seen below.

Enter text to convert to art: Hello
 _   _        _  _        
| | | |  ___ | || |  ___  
| |_| | / _ \| || | / _ \ 
|  _  ||  __/| || || (_) |
|_| |_| \___||_||_| \___/ 
                          
>>>

Take a look at some of our other content around the Python programming language by clicking here.

Leave a Reply