DEV Community

Fahmi Nurfikri
Fahmi Nurfikri

Posted on • Originally published at Medium

Creating Simple FontArt using Python

Python is a programming language that is widely used in the world. One of the reasons is that Python is a language that is easy to learn and can be used for many platforms.

After using Python for a long time, maybe we feel bored with the appearance of the output that is just like that. Now, in this post, I will give a few tips on how to add FontArt to the Python output display.

The method is quite easy, the first thing we have to do is install the PyFiglet library. PyFiglet converts ASCII text to ASCII art font.

pip install pyfiglet
Enter fullscreen mode Exit fullscreen mode

After the installation is complete, then open the code editor and type the following code.

import pyfiglet
result = pyfiglet.figlet_format('Miloo Project')
print(result)
Enter fullscreen mode Exit fullscreen mode

The result of the code is like this.

Image description

In addition, we can also change the displayed font, by adding a font parameter to the .figlet_format function.

import pyfiglet
result = pyfiglet.figlet_format('Miloo Project', font='banner3-D')
print(result)
Enter fullscreen mode Exit fullscreen mode

And the result will be like this.

Image description

You can get the type of font itself on this page.

You can find the complete code on GitHub.

That’s all for this post, if you have any questions, please write in the comments. Thank you.

Top comments (0)