Style to Python Console

Medea - Feb 23 '22 - - Dev Community

The Python console looks pretty dull, doesn't it?

dull, boring

Well, I know a way you can add style to the Python Console...


  _   _   _   _   _   _   _   _  
 / \ / \ / \ / \ / \ / \ / \ / \ 
( P | y | F | i | g | l | e | t )
 \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ 

Enter fullscreen mode Exit fullscreen mode

oOoOOoOOo         o     o                   .oOo 
    o            O     O                    O    
    o            O     o                    o    
    O            o     O                    OoO  
    o     .oOoO' OoOo. o  .oOo.       .oOo. o    
    O     O   o  O   o O  OooO'       O   o O    
    O     o   O  o   O o  O           o   O o    
    o'    `OoO'o `OoO' Oo `OoO'       `OoO' O'   


 .oOOOo.                                              
.O     o                                              
o                        O                  O         
o                       oOo                oOo        
o         .oOo. 'OoOo.   o   .oOo. 'OoOo.   o   .oOo  
O         O   o  o   O   O   OooO'  o   O   O   `Ooo. 
`o     .o o   O  O   o   o   O      O   o   o       O 
 `OoooO'  `OoO'  o   O   `oO `OoO'  o   O   `oO `OoO' 
Enter fullscreen mode Exit fullscreen mode

Introduction
Setting it up
Some fonts in PyFiglet
Conclusion


Introduction

The PyFiglet modules takes ASCII text and converts it to cool ASCII art fonts. The function Figlet in the PyFiglet module is used to set a font, so you can easily render it.

Setting it up

The command to install the PyFiglet module is:

pip install pyfiglet
Enter fullscreen mode Exit fullscreen mode

Then, wherever you are writing your code, import PyFiglet, by doing what it shows below:

import pyfiglet
Enter fullscreen mode Exit fullscreen mode

To set up your font, you have to do the code below, obviously replacing the [font_name] with an actual font name in PyFiglet:

f = Figlet(font='[font_name]')
Enter fullscreen mode Exit fullscreen mode

The font argument is optional, and if you don't mention it when declaring the argument, your class called f will have the standard font.

To show your text with the ASCII art fonts, you will have to use the function renderText in the class f, like below:

print(f.renderText('looks cool'))
Enter fullscreen mode Exit fullscreen mode

Some fonts in PyFiglet

There are 425 different fonts in PyFiglet, and you can see all their names by doing the code below:

from pyfiglet import FigletFont
print(FigletFont.getFonts())
Enter fullscreen mode Exit fullscreen mode

But to save you some time, I'm going to go through the fonts in PyFiglet which I think stand out.

  • standard

The standard is one of the best fonts, especially if it's the first ASCII art font you see.

 _             _                          _ 
| | ___   ___ | | _____    ___ ___   ___ | |
| |/ _ \ / _ \| |/ / __|  / __/ _ \ / _ \| |
| | (_) | (_) |   <\__ \ | (_| (_) | (_) | |
|_|\___/ \___/|_|\_\___/  \___\___/ \___/|_|
Enter fullscreen mode Exit fullscreen mode
  • weird

The weird font is just supposed to look weird, I guess.

/           /                             /
(  ___  ___ (     ___       ___  ___  ___ ( 
| |   )|   )|___)|___      |    |   )|   )| 
| |__/ |__/ | \   __/      |__  |__/ |__/ | 
Enter fullscreen mode Exit fullscreen mode
  • wavy

The wavy font is pretty wavy.

 ) _   _ ( _  _    _  _   _   ) 
( (_) (_) )\ (    (_ (_) (_) (  
             _)                 
Enter fullscreen mode Exit fullscreen mode
  • univers

The univers font has it's name spelt wrong, but it looks nice.

88                         88                   
88                         88                   
88                         88                   
88  ,adPPYba,   ,adPPYba,  88   ,d8  ,adPPYba,  
88 a8"     "8a a8"     "8a 88 ,a8"   I8[    ""  
88 8b       d8 8b       d8 8888[      `"Y8ba,   
88 "8a,   ,a8" "8a,   ,a8" 88`"Yba,  aa    ]8I  
88  `"YbbdP"'   `"YbbdP"'  88   `Y8a `"YbbdP"'  



                                   88  
                                   88  
                                   88  
 ,adPPYba,  ,adPPYba,   ,adPPYba,  88  
a8"     "" a8"     "8a a8"     "8a 88  
8b         8b       d8 8b       d8 88  
"8a,   ,aa "8a,   ,a8" "8a,   ,a8" 88  
 `"Ybbd8"'  `"YbbdP"'   `"YbbdP"'  88  
Enter fullscreen mode Exit fullscreen mode
  • type_set

The type_set font just uses hashtags to make art which looks very similar to letters.

#      ##     ##   #    # ####      ###   ##     ##   #       
 #     #  #   #  #  #   # #    #    #   # #  #   #  #  #       
 #    #    # #    # #  #  #        #     #    # #    # #       
 #    #    # #    # ###    ####    #     #    # #    # #       
 #    #    # #    # #  #       #   #     #    # #    # #       
 #     #  #   #  #  #   # #    #    #   # #  #   #  #  #       
 ###### ##     ##   #    # ####      ###   ##     ##   ###### 
Enter fullscreen mode Exit fullscreen mode
  • tombstone

The tombstone font uses tildas for the base and underscores and apostrophes for the top.

 _,   _,  _, _,_  _,    _,  _,  _, _, 
 |   / \ / \ |_/ (_    / ` / \ / \ |  
 | , \ / \ / | \ , )   \ , \ / \ / | ,
 ~~~  ~   ~  ~ ~  ~     ~   ~   ~  ~~~
Enter fullscreen mode Exit fullscreen mode
  • stop.

The stop font makes the words look bubbly.

 _             _                              _ 
| |           | |                            | |
| | ___   ___ | |  _  ___     ____ ___   ___ | |
| |/ _ \ / _ \| | / )/___)   / ___) _ \ / _ \| |
| | |_| | |_| | |< (|___ |  ( (__| |_| | |_| | |
|_|\___/ \___/|_| \_|___/    \____)___/ \___/|_|
Enter fullscreen mode Exit fullscreen mode
  • threepoint

The threepoint font makes the words look pointy. It looks similar to the twopoint font.

| _  _ |  _   _ _  _ |
|(_)(_)|<_\  (_(_)(_)|
Enter fullscreen mode Exit fullscreen mode
  • starwars

The starwars font makes the words look like the words in the introduction of star wars.

 __        ______     ______    __  ___      _______.
|  |      /  __  \   /  __  \  |  |/  /     /       |
|  |     |  |  |  | |  |  |  | |  '  /     |   (----`
|  |     |  |  |  | |  |  |  | |    <       \   \    
|  `----.|  `--'  | |  `--'  | |  .  \  .----)   |   
|_______| \______/   \______/  |__|\__\ |_______/    

  ______   ______     ______    __      
 /      | /  __  \   /  __  \  |  |     
|  ,----'|  |  |  | |  |  |  | |  |     
|  |     |  |  |  | |  |  |  | |  |     
|  `----.|  `--'  | |  `--'  | |  `----.
 \______| \______/   \______/  |_______|
Enter fullscreen mode Exit fullscreen mode
  • slant

The slant font makes the words look slant. As simple as that.

    __            __                            __
   / /___  ____  / /_______   _________  ____  / /
  / / __ \/ __ \/ //_/ ___/  / ___/ __ \/ __ \/ / 
 / / /_/ / /_/ / ,< (__  )  / /__/ /_/ / /_/ / /  
/_/\____/\____/_/|_/____/   \___/\____/\____/_/   
Enter fullscreen mode Exit fullscreen mode
  • smkeyboard

The smkeyboard font makes the letters look like they are the keys of a keyboard.

 ____ ____ ____ ____ ____ _________ ____ ____ ____ ____ 
||l |||o |||o |||k |||s |||       |||c |||o |||o |||l ||
||__|||__|||__|||__|||__|||_______|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|/_______\|/__\|/__\|/__\|/__\|
Enter fullscreen mode Exit fullscreen mode
  • isometric1

The isometric1 font makes the words look isometric.

      ___       ___           ___           ___           ___     
     /\__\     /\  \         /\  \         /\__\         /\  \    
    /:/  /    /::\  \       /::\  \       /:/  /        /::\  \   
   /:/  /    /:/\:\  \     /:/\:\  \     /:/__/        /:/\ \  \  
  /:/  /    /:/  \:\  \   /:/  \:\  \   /::\__\____   _\:\~\ \  \ 
 /:/__/    /:/__/ \:\__\ /:/__/ \:\__\ /:/\:::::\__\ /\ \:\ \ \__\
 \:\  \    \:\  \ /:/  / \:\  \ /:/  / \/_|:|~~|~    \:\ \:\ \/__/
  \:\  \    \:\  /:/  /   \:\  /:/  /     |:|  |      \:\ \:\__\  
   \:\  \    \:\/:/  /     \:\/:/  /      |:|  |       \:\/:/  /  
    \:\__\    \::/  /       \::/  /       |:|  |        \::/  /   
     \/__/     \/__/         \/__/         \|__|         \/__/    
      ___           ___           ___           ___ 
     /\  \         /\  \         /\  \         /\__\
    /::\  \       /::\  \       /::\  \       /:/  /
   /:/\:\  \     /:/\:\  \     /:/\:\  \     /:/  / 
  /:/  \:\  \   /:/  \:\  \   /:/  \:\  \   /:/  /  
 /:/__/ \:\__\ /:/__/ \:\__\ /:/__/ \:\__\ /:/__/   
 \:\  \  \/__/ \:\  \ /:/  / \:\  \ /:/  / \:\  \   
  \:\  \        \:\  /:/  /   \:\  /:/  /   \:\  \  
   \:\  \        \:\/:/  /     \:\/:/  /     \:\  \ 
    \:\__\        \::/  /       \::/  /       \:\__\
     \/__/         \/__/         \/__/         \/__/
Enter fullscreen mode Exit fullscreen mode
  • shimrod

The shimrod font makes the words look elongated.

.         ,                     . 
|         |                     | 
| ,-. ,-. | , ,-.   ,-. ,-. ,-. | 
| | | | | |<  `-.   |   | | | | | 
' `-' `-' ' ` `-'   `-' `-' `-' ' 
Enter fullscreen mode Exit fullscreen mode
  • serifcap

The serifcap font makes the words look floaty and bubbly.

(  )  /  \  /  \( ) ) / __)   / _)/  \  /  \(  )  
 )(__( () )( () ))  \ \__ \  ( (_( () )( () ))(__ 
(____)\__/  \__/(_)\_)(___/   \__)\__/  \__/(____)
Enter fullscreen mode Exit fullscreen mode
  • xcour

The xcour font makes the words look fancy just with hashtags.

 ##             ##                           ##   
  #              #                            #   
  #    ##   ##   # ##  ###    ##   ##   ##    #   
  #   #  # #  #  # #  #      #  # #  # #  #   #   
  #   #  # #  #  ##    ##    #    #  # #  #   #   
  #   #  # #  #  # #     #   #  # #  # #  #   #   
#####  ##   ##  ## ## ###     ##   ##   ##  ##### 
Enter fullscreen mode Exit fullscreen mode
  • poison

The poison font makes the words look like poison dripping on them.

@@@        @@@@@@    @@@@@@   @@@  @@@   @@@@@@   
@@@       @@@@@@@@  @@@@@@@@  @@@  @@@  @@@@@@@   
@@!       @@!  @@@  @@!  @@@  @@!  !@@  !@@       
!@!       !@!  @!@  !@!  @!@  !@!  @!!  !@!       
@!!       @!@  !@!  @!@  !@!  @!@@!@!   !!@@!!    
!!!       !@!  !!!  !@!  !!!  !!@!!!     !!@!!!   
!!:       !!:  !!!  !!:  !!!  !!: :!!        !:!  
 :!:      :!:  !:!  :!:  !:!  :!:  !:!      !:!   
 :: ::::  ::::: ::  ::::: ::   ::  :::  :::: ::   
: :: : :   : :  :    : :  :    :   :::  :: : :    


 @@@@@@@   @@@@@@    @@@@@@   @@@       
@@@@@@@@  @@@@@@@@  @@@@@@@@  @@@       
!@@       @@!  @@@  @@!  @@@  @@!       
!@!       !@!  @!@  !@!  @!@  !@!       
!@!       @!@  !@!  @!@  !@!  @!!       
!!!       !@!  !!!  !@!  !!!  !!!       
:!!       !!:  !!!  !!:  !!!  !!:       
:!:       :!:  !:!  :!:  !:!   :!:      
 ::: :::  ::::: ::  ::::: ::   :: ::::  
 :: :: :   : :  :    : :  :   : :: : : 
Enter fullscreen mode Exit fullscreen mode
  • linux

The linux font makes the words look really bubbly (and linuxy)

.-.   .----..----..-.,-..---. .---..----..----..-.   
| |__ | || || || || . <  \ \  | |  | || || || || |__ 
`----'`----'`----'`-'`-'`---' `---'`----'`----'`----'
Enter fullscreen mode Exit fullscreen mode
  • gothic

Yes you guessed it right. The gothic font makes the words look gothic-like.

,,             ,,                                ,, 
||             ||                                || 
||  /'\\  /'\\ ||/\  _-_,        _-_  /'\\  /'\\ || 
|| || || || || ||_< ||_.        ||   || || || || || 
|| || || || || || |  ~ ||       ||   || || || || || 
\\ \\,/  \\,/  \\,\ ,-_-        \\,/ \\,/  \\,/  \\ 
Enter fullscreen mode Exit fullscreen mode
  • fuzzy

The fuzzy font makes the words look fuzzy and bubbly.

.-.              .-.                             .-.  
: :              : :.-.                          : :  
: :   .--.  .--. : `'.' .--.    .--.  .--.  .--. : :  
: :_ ' .; :' .; :: . `.`._-.'  '  ..'' .; :' .; :: :_ 
`.__;`.__.'`.__.':_;:_;`.__.'  `.__.'`.__.'`.__.'`.__;
Enter fullscreen mode Exit fullscreen mode
  • fender

The fender font makes the words look straighter.

'||`               '||                                   '||` 
 ||                 ||                                    ||  
 ||  .|''|, .|''|,  || //`  (''''    .|'', .|''|, .|''|,  ||  
 ||  ||  || ||  ||  ||<<     `'')    ||    ||  || ||  ||  ||  
.||. `|..|' `|..|' .|| \\.  `...'    `|..' `|..|' `|..|' .||. 
Enter fullscreen mode Exit fullscreen mode
  • epic

The epic font makes the words look medieval.

 _        _______  _______  _        _______ 
( \      (  ___  )(  ___  )| \    /\(  ____ \
| (      | (   ) || (   ) ||  \  / /| (    \/
| |      | |   | || |   | ||  (_/ / | (_____ 
| |      | |   | || |   | ||   _ (  (_____  )
| |      | |   | || |   | ||  ( \ \       ) |
| (____/\| (___) || (___) ||  /  \ \/\____) |
(_______/(_______)(_______)|_/    \/\_______)

 _______  _______  _______  _       
(  ____ \(  ___  )(  ___  )( \      
| (    \/| (   ) || (   ) || (      
| |      | |   | || |   | || |      
| |      | |   | || |   | || |      
| |      | |   | || |   | || |      
| (____/\| (___) || (___) || (____/\
(_______/(_______)(_______)(_______/
Enter fullscreen mode Exit fullscreen mode
  • dotmatrix

The dotmatrix font makes the words look dotty.

 _  _                                  _                         
(_)(_)                                (_)                        
   (_)      _  _  _        _  _  _    (_)     _   _  _  _  _     
   (_)   _ (_)(_)(_) _  _ (_)(_)(_) _ (_)   _(_)_(_)(_)(_)(_)    
   (_)  (_)         (_)(_)         (_)(_) _(_) (_)_  _  _  _     
   (_)  (_)         (_)(_)         (_)(_)(_)_    (_)(_)(_)(_)_   
 _ (_) _(_) _  _  _ (_)(_) _  _  _ (_)(_)  (_)_   _  _  _  _(_)  
(_)(_)(_)  (_)(_)(_)      (_)(_)(_)   (_)    (_) (_)(_)(_)(_)    


                                        _  _          
                                       (_)(_)         
   _  _  _    _  _  _        _  _  _      (_)         
 _(_)(_)(_)_ (_)(_)(_) _  _ (_)(_)(_) _   (_)         
(_)       (_)         (_)(_)         (_)  (_)         
(_)       (_)         (_)(_)         (_)  (_)         
(_)_  _  _(_) _  _  _ (_)(_) _  _  _ (_)_ (_) _       
  (_)(_)(_)  (_)(_)(_)      (_)(_)(_)  (_)(_)(_)    
Enter fullscreen mode Exit fullscreen mode
  • caligraphy

The caligraphy font is a bit like the gothic font, but more bigger, pointier and it only uses asterisks.

***                             *                   
 ***                          **                    
  **                          **                    
  **                          **                    
  **       ****       ****    **            ****    
  **      * ***  *   * ***  * **  ***      * **** * 
  **     *   ****   *   ****  ** * ***    **  ****  
  **    **    **   **    **   ***   *    ****       
  **    **    **   **    **   **   *       ***      
  **    **    **   **    **   **  *          ***    
  **    **    **   **    **   ** **            ***  
  **    **    **   **    **   ******      ****  **  
  **     ******     ******    **  ***    * **** *   
  *** *   ****       ****     **   *** *    ****    
   ***                         **   ***             






                                 ***     
                                  ***    
                                   **    
                                   **    
              ****       ****      **    
   ****      * ***  *   * ***  *   **    
  * ***  *  *   ****   *   ****    **    
 *   ****  **    **   **    **     **    
**         **    **   **    **     **    
**         **    **   **    **     **    
**         **    **   **    **     **    
**         **    **   **    **     **    
***     *   ******     ******      **    
 *******     ****       ****       *** * 
  *****                             *** 
Enter fullscreen mode Exit fullscreen mode
  • avatar

The avatar font is like the epic font, but a bit more smaller and pointier.

 _     ____  ____  _  __ ____    ____ ____  ____  _    
/ \   /  _ \/  _ \/ |/ // ___\  /   _Y  _ \/  _ \/ \   
| |   | / \|| / \||   / |    \  |  / | / \|| / \|| |   
| |_/\| \_/|| \_/||   \ \___ |  |  \_| \_/|| \_/|| |_/\
\____/\____/\____/\_|\_\\____/  \____|____/\____/\____/
Enter fullscreen mode Exit fullscreen mode
  • broadway

The broadway font on PyFiglet, looks a lot like the actual font, but it uses a lot of 8s.

8 8888         ,o888888o.         ,o888888o.     8 8888     ,88'   d888888o.   
8 8888      . 8888     `88.    . 8888     `88.   8 8888    ,88'  .`8888:' `88. 
8 8888     ,8 8888       `8b  ,8 8888       `8b  8 8888   ,88'   8.`8888.   Y8 
8 8888     88 8888        `8b 88 8888        `8b 8 8888  ,88'    `8.`8888.     
8 8888     88 8888         88 88 8888         88 8 8888 ,88'      `8.`8888.    
8 8888     88 8888         88 88 8888         88 8 8888 88'        `8.`8888.   
8 8888     88 8888        ,8P 88 8888        ,8P 8 888888<          `8.`8888.  
8 8888     `8 8888       ,8P  `8 8888       ,8P  8 8888 `Y8.    8b   `8.`8888. 
8 8888      ` 8888     ,88'    ` 8888     ,88'   8 8888   `Y8.  `8b.  ;8.`8888 
8 888888888888 `8888888P'         `8888888P'     8 8888     `Y8. `Y8888P ,88P' 

    ,o888888o.        ,o888888o.         ,o888888o.     8 8888         
   8888     `88.   . 8888     `88.    . 8888     `88.   8 8888         
,8 8888       `8. ,8 8888       `8b  ,8 8888       `8b  8 8888         
88 8888           88 8888        `8b 88 8888        `8b 8 8888         
88 8888           88 8888         88 88 8888         88 8 8888         
88 8888           88 8888         88 88 8888         88 8 8888         
88 8888           88 8888        ,8P 88 8888        ,8P 8 8888         
`8 8888       .8' `8 8888       ,8P  `8 8888       ,8P  8 8888         
   8888     ,88'   ` 8888     ,88'    ` 8888     ,88'   8 8888         
    `8888888P'        `8888888P'         `8888888P'     8 888888888888 
Enter fullscreen mode Exit fullscreen mode

Conclusion

The Python console can look a bit dull sometimes, but if you add in some effort, you can make it look great!

Hope you enjoyed reading this and learnt something new.

CAN YOU FIND WHICH FONTS ARE BEING USED IN THE HEADERS???

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .