Python | ASCII art using pyfiglet module
Last Updated :
29 Jun, 2018
pyfiglet takes ASCII text and renders it in ASCII art fonts.
figlet_format
method convert ASCII text into ASCII art fonts.
It takes following arguments :
text
font ( DEFAULT_FONT = 'standard' )
Command to install pyfiglet module :
pip install pyfiglet
Code #1: Text in default font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("Geeks For Geeks")
print(result)
Output:
____ _ _____ ____ _
/ ___| ___ ___| | _____ | ___|__ _ __ / ___| ___ ___| | _____
| | _ / _ \/ _ \ |/ / __| | |_ / _ \| '__| | | _ / _ \/ _ \ |/ / __|
| |_| | __/ __/ \__ \ | _| (_) | | | |_| | __/ __/ \__ \
\____|\___|\___|_|\_\___/ |_| \___/|_| \____|\___|\___|_|\_\___/
Code #2: Text in slant font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("Geeks For Geeks", font = "slant" )
print(result)
Output:
______ __ ______ ______ __
/ ____/__ ___ / /_______ / ____/___ _____ / ____/__ ___ / /_______
/ / __/ _ \/ _ \/ //_/ ___/ / /_ / __ \/ ___/ / / __/ _ \/ _ \/ //_/ ___/
/ /_/ / __/ __/ (__ ) / __/ / /_/ / / / /_/ / __/ __/ (__ )
\____/\___/\___/_/|_/____/ /_/ \____/_/ \____/\___/\___/_/|_/____/
Code #3: Text in 3-d font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("G e e k", font = "3-d" )
print(result)
Output:
******** **
**//////** /**
** // ***** ***** /** **
/** **///** **///** /** **
/** ***** /******* /******* /****
//** ////** /**//// /**//// /**/**
//******** //****** //****** /**//**
//////// ////// ////// // //
Code #4: Text in 3x5 font
Python3
# importing pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("G e e k", font = "3x5" )
print(result)
Output:
## #
# ### ### # #
# # ## ## ##
# # ### ### # #
##
Code #5: Text in 5lineoblique font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("G e e k", font = "5lineoblique" )
print(result)
Output:
// ) )
// ___ ___ / ___
// ____ //___) ) //___) ) //\ \
// / / // // // \ \
((____/ / ((____ ((____ // \ \
Code #6: Text in alphabet font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("G e e k", font = "alphabet" )
print(result)
Output:
GGG k
G k k
G GG eee eee kk
G G e e e e k k
GGG ee ee k k
Code #7: Text in banner3-D font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("Geeks", font = "banner3-D" )
print(result)
Output:
:'######:::'########:'########:'##:::'##::'######::
'##... ##:: ##.....:: ##.....:: ##::'##::'##... ##:
##:::..::: ##::::::: ##::::::: ##:'##::: ##:::..::
##::'####: ######::: ######::: #####::::. ######::
##::: ##:: ##...:::: ##...:::: ##. ##::::..... ##:
##::: ##:: ##::::::: ##::::::: ##:. ##::'##::: ##:
. ######::: ########: ########: ##::. ##:. ######::
:......::::........::........::..::::..:::......:::
Code #8: Text in doh font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("Geeks", font = "doh" )
print(result)
Output:
GGGGGGGGGGGGG kkkkkkkk
GGG::::::::::::G k::::::k
GG:::::::::::::::G k::::::k
G:::::GGGGGGGG::::G k::::::k
G:::::G GGGGGG eeeeeeeeeeee eeeeeeeeeeee k:::::k kkkkkkk
G:::::G ee::::::::::::ee ee::::::::::::ee k:::::k k:::::k
G:::::G e::::::eeeee:::::ee e::::::eeeee:::::eek:::::k k:::::k
G:::::G GGGGGGGGGGe::::::e e:::::ee::::::e e:::::ek:::::k k:::::k
G:::::G G::::::::Ge:::::::eeeee::::::ee:::::::eeeee::::::ek::::::k:::::k
G:::::G GGGGG::::Ge:::::::::::::::::e e:::::::::::::::::e k:::::::::::k
G:::::G G::::Ge::::::eeeeeeeeeee e::::::eeeeeeeeeee k:::::::::::k
G:::::G G::::Ge:::::::e e:::::::e k::::::k:::::k
G:::::GGGGGGGG::::Ge::::::::e e::::::::e k::::::k k:::::k
GG:::::::::::::::G e::::::::eeeeeeee e::::::::eeeeeeee k::::::k k:::::k
GGG::::::GGG:::G ee:::::::::::::e ee:::::::::::::e k::::::k k:::::k
GGGGGG GGGG eeeeeeeeeeeeee eeeeeeeeeeeeee kkkkkkkk kkkkkkk
Code #9: Text in isometric1 font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("Geeks", font = "isometric1" )
print(result)
Output:
___ ___ ___ ___ ___
/\ \ /\ \ /\ \ /\__\ /\ \
/::\ \ /::\ \ /::\ \ /:/ / /::\ \
/:/\:\ \ /:/\:\ \ /:/\:\ \ /:/__/ /:/\ \ \
/:/ \:\ \ /::\~\:\ \ /::\~\:\ \ /::\__\____ _\:\~\ \ \
/:/__/_\:\__\ /:/\:\ \:\__\ /:/\:\ \:\__\ /:/\:::::\__\ /\ \:\ \ \__\
\:\ /\ \/__/ \:\~\:\ \/__/ \:\~\:\ \/__/ \/_|:|~~|~ \:\ \:\ \/__/
\:\ \:\__\ \:\ \:\__\ \:\ \:\__\ |:| | \:\ \:\__\
\:\/:/ / \:\ \/__/ \:\ \/__/ |:| | \:\/:/ /
\::/ / \:\__\ \:\__\ |:| | \::/ /
\/__/ \/__/ \/__/ \|__| \/__/
Code #10: Text in letters font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("Geeks", font = "letters" )
print(result)
Output:
GGGG kk
GG GG eee eee kk kk sss
GG ee e ee e kkkkk s
GG GG eeeee eeeee kk kk sss
GGGGGG eeeee eeeee kk kk s
sss
Code #11: Text in alligator font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("G e e k", font = "alligator" )
print(result)
Output:
:::::::: :::::::::: :::::::::: ::: :::
:+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ +:+
:#: +#++:++# +#++:++# +#++:++
+#+ +#+# +#+ +#+ +#+ +#+
#+# #+# #+# #+# #+# #+#
######## ########## ########## ### ###
Code #12: Text in dot matrix font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("Geeks", font = "dotmatrix" )
print(result)
Output:
_ _ _ _
_ (_)(_)(_) _ (_)
(_) (_) _ _ _ _ _ _ _ _ (_) _ _ _ _ _
(_) _ _ _ (_)(_)(_)(_)_ (_)(_)(_)(_)_ (_) _(_)_(_)(_)(_)(_)
(_) (_)(_)(_)(_) _ _ _ (_)(_) _ _ _ (_)(_) _(_) (_)_ _ _ _
(_) (_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)(_)_ (_)(_)(_)(_)_
(_) _ _ _ (_)(_)_ _ _ _ (_)_ _ _ _ (_) (_)_ _ _ _ _(_)
(_)(_)(_)(_) (_)(_)(_)(_) (_)(_)(_)(_) (_) (_) (_)(_)(_)(_)
Code #13: Text in bubble font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("Geeks For Geeks", font = "bubble" )
print(result)
Output:
_ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( G | e | e | k | s ) ( F | o | r ) ( G | e | e | k | s )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
Code #14: Text in bubblehead font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("Geeks For Geeks", font = "bulbhead" )
print(result)
Output:
___ ____ ____ _ _ ___ ____ _____ ____
/ __)( ___)( ___)( )/ )/ __) ( ___)( _ )( _ \
( (_-. )__) )__) ) ( \__ \ )__) )(_)( ) /
\___/(____)(____)(_)\_)(___/ (__) (_____)(_)\_)
___ ____ ____ _ _ ___
/ __)( ___)( ___)( )/ )/ __)
( (_-. )__) )__) ) ( \__ \
\___/(____)(____)(_)\_)(___/
Code #15: Text in digital font
Python3
# import pyfiglet module
import pyfiglet
result = pyfiglet.figlet_format("Geeks For Geeks", font = "digital" )
print(result)
Output:
+-+-+-+-+-+ +-+-+-+ +-+-+-+-+-+
|G|e|e|k|s| |F|o|r| |G|e|e|k|s|
+-+-+-+-+-+ +-+-+-+ +-+-+-+-+-+
Similar Reads
Art module in Python Art package is used to print decorative art's on the terminal as well as to save in file and a word can be represented by " | "and can be saved in a file Installation This module doesn't come built-in with Python. To install this type the below command in the terminal. pip install art Function: Pri
2 min read
Adding Text on Image using Python - PIL In Python to open an image, image editing, saving that image in different formats one additional library called Python Imaging Library (PIL). Using this PIL we can do so many operations on images like create a new Image, edit an existing image, rotate an image, etc. For adding text we have to follow
2 min read
How to create Word Art from an image using Python? In this article, we are going to learn how to create word art from an image using Python. In this, we are going to take an image as input and then created a similar image in a text form using the characters. We can perform this task with the help of pillow and pywhatkit modules of Python. Pillow Thi
2 min read
PYGLET â Showing Image using Sprite In this article we will see how we can show image on the window in PYGLET module in python. Pyglet is easy to use but powerful library for developing visually rich GUI applications like games, multimedia etc. A window is a "heavyweight" object occupying operating system resources. Windows may appear
2 min read
Generating Beautiful Code Snippets using Python When creating technical documentation or tutorials, it can be helpful to include images of code snippets to illustrate specific examples or concepts. However, taking a screenshot of a code file can look unprofessional and hard to read. This article will explore how to convert programming code into b
3 min read