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
Python Pillow - Using Image Module
In this article, we will see how to work with Image Module of PIL in Python. First, let's see how to install the PIL. Installation: Linux: On the Linux terminal type the following: pip install Pillow Installing pip via terminal: sudo apt-get update sudo apt-get install python-pipWorking with Image
5 min read
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
Python | Generate QR Code using pyqrcode module
Let's see how to generate QR code in Python using pyqrcode module. pyqrcode module is a QR code generator. The module automates most of the building process for creating QR codes. This module attempts to follow the QR code standard as closely as possible. The terminology and the encodings used in py
2 min read
Python Pillow - ImageDraw Module
Python's Pillow which is a fork of the discontinued Python Imaging Library (PIL) is a powerful library that is capable of adding image processing capabilities to your python code. Pillow offers many modules that ease the process of working and modifying images. In this article, we will have a look a
5 min read
Generate Captcha Using Python
In this article, we are going to see how to generate a captcha using Python package captcha to generate our own CAPTCHA (Completely Automated Public Turing Test to Tell Computers and Humans Apart) in picture form. CAPTCHA is a form of challenge-response authentication security mechanism. CAPTCHA pre
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
Create a plot with Multiple Glyphs using Python Bokeh
In this article, we will be learning about multiple glyphs and also about adding a legend in bokeh. Now bokeh provides us with a variety of glyphs that can be used to represent a point in a plot. Some glyphs are circle, square, asterik, inverted_triangle(), triangle() etc. Installation This module d
7 min read
Matplotlib.pyplot.savefig() in Python
savefig() function in Python is used to save a plot created with Matplotlib to a file. It supports various formats like PNG, PDF, SVG, and more. This method allows you to specify additional parameters like file name, resolution, layout, and transparency, giving you control over the appearance and qu
3 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
Make an Circle Glyphs in Python using Bokeh
Bokeh is a Python interactive data visualization. Unlike Matplotlib and Seaborn, Bokeh renders its plots using HTML and JavaScript. It targets modern web browsers for presentation providing elegant, concise construction of novel graphics with high-performance interactivity. Plotting the Circle Glyph
4 min read