How to add Emojis in a Python Program
Hello everyone, In this tutorial, we’ll be learning how we can add Emojis in a Python Program. Emojis are a visual representation of an emotion or an entity from various genres. It can be used to make something more readable and is a very good way to show emotions and feelings. We will make use of External Python library named ‘Emoji’ to add emojis and to decode an emoji into its text representation. Let us start this tutorial by Installing the required library.
Installing Emoji
To install Emoji, Goto Command line and run the following command.
pip install emoji
Now we can make use of emoji in our Python Program.
Using Emoji with Python
The first step is to import the required library.
import emoji
Now let us Print a sentence with emoji. For this, we will be using emojize() which can make an emoji out of a specific text and see what we will get.
print(emoji.emojize('Python is a dangerous :snake:)
Leave a Reply