Emoji 🀣😊 in Python

Emoji 🀣😊 in Python

Β·

2 min read

Emoji's language is the world’s fastest-growing language and there are more than 3000 emojis. So Why not start using emoji in our python program. In this article, you will learn how to use emoji in python.

For using emoji in python we need to install an emoji library, so open your command prompt and run this command.

pip install emoji

This Command will install the emoji library on your computer and now you are ready to use emoji in your python program.

This library uses an emoji cheat sheet to display emoji of that particular cheat._ Cheat Sheet

>>> import emoji
#This command will import emoji library in your program
>>> print(emoji.emojize('Give a :thumbs_up: to this article.'))
Give a πŸ‘ to this article.
>>> print(emoji.emojize('Give a :red_heart: to this article.'))
Give a ❀ to this article.

By default, you can only use few emojis from the cheat sheet but for using the complete list you need to add emoji.emojize(use_aliases=True) in your code, this is how we do that.

>>> import emoji

>>> print(emoji.emojize('Are you feeling :angry:', use_aliases=True))
Are you feeling 😠
>>> print(emoji.emojize('Dont forget to wear your :mask:', use_aliases=True))
Dont forget to wear your 😷

That's it for this article, this is my third article so share some feedback to improve in the comment section.

Did you find this article valuable?

Support Ankit Kumar by becoming a sponsor. Any amount is appreciated!