Dheeraj Choudhary
Dheeraj Choudhary's Blog

Dheeraj Choudhary's Blog

πŸ˜ŠπŸ€”Emojis πŸ˜ŽπŸ˜‡ Using 🚨🚨Python🚨🚨

πŸ˜ŠπŸ€”Emojis πŸ˜ŽπŸ˜‡ Using 🚨🚨Python🚨🚨

Dheeraj Choudhary
Β·Sep 13, 2021Β·

4 min read

Subscribe to my newsletter and never miss my upcoming articles

Emogi is a small digital image or icon used to express an idea or emotion.

Emojis are the β€œheart” of any text conversation. They are the most interactive elements of any conversation. Over the internet, it may be difficult to express your feelings, emojis can help you to do the same. You and your friends may probably be using different emojis in your chats. Those cute little faces to broken heart emoji, it is very interesting and easy to use them in your day to day conversation.

Being a python programmer have you ever thought of using emojis in your programs?

You might be thinking for doing the same you will have to write big algorithm to print emojis. But its not as complex as you are thinking.

Python has multiple ways of using emoji in your python program which you can print in very simplified manner. These 3 ways are as follows.

  1. Unicodes
  2. CLDR names
  3. Emoji Module

Before we explore the ways to use this in code lets explore list of emojis available for us to use

  1. For Full Emoji List click here :- This chart provides a list of the Unicode emoji characters and sequences, with images from different vendors, CLDR name, date, source, and keywords.
  2. For Full Emoji Modifier Sequences click here :- Emoji with skin-tones are listed here.
  3. For counts of emoji, see

Now lets try to utilize these emojis in our python code.

πŸ˜€EmojisπŸ˜ƒ In Python Using Unicode's:

To use Unicode's in python , we need to replace β€œ+” with β€œ000” from the list of Unicode's.
For example : β€œU+1F600” will become β€œU0001F600” and prefix the Unicode with β€œ\” escape character and print it.
Few working examples for your reference is as follows

print("\U0001F600") #This is smiley for grinning face πŸ˜€
print("\U0001F603") #This is smiley for grinning face with big eyes πŸ˜ƒ
print("\U0001F604") #This is smiley for grinning face with smiling eyes πŸ˜„
print("\U0001F601") #This is smiley for beaming face with smiling eyes 😁
print("\U0001F606") #This is smiley for grinning squinting face πŸ˜†
print("\U0001F605") #This is smiley for grinning face with sweat πŸ˜…
print("\U0001F923") #This is smiley for rolling on the floor laughing 🀣
print("\U0001F602") #This is smiley for face with tears of joy πŸ˜‚
print("\U0001F642") #This is smiley for slightly smiling face πŸ™‚
print("\U0001F643") #This is smiley for upside-down face πŸ™ƒ
print("\U0001FAE0") #This is smiley for melting face 🫠
print("\U0001F609") #This is smiley for winking face πŸ˜‰
print("\U0001F60A") #This is smiley for smiling face with smiling eyes 😊
print("\U0001F607") #This is smiley for smiling face with halo πŸ˜‡

πŸ˜†Emojis πŸ˜… In Python Using CLDR Names

Emojis have CLDR short names which can also be used. While implementing it in python code put \N at start and the CLDR Names in "{}" braces to use it.
Few working examples for your reference is as follows

print("This is grinning face Smiley: ""\N{grinning face}") πŸ˜€
print("This is grinning face with smiling eyes Smiley: ""\N{grinning face with smiling eyes}") 😁
print("This is rolling on the floor laughing Smiley: ""\N{rolling on the floor laughing}") 🀣
print("This is face with tears of joy Smiley: ""\N{face with tears of joy}") πŸ˜‚
print("This is slightly smiling face Smiley: ""\N{slightly smiling face}") πŸ™‚
print("This is upside-down face Smiley: ""\N{upside-down face}") πŸ™ƒ
print("This is winking face Smiley: ""\N{winking face}") πŸ˜‰
print("This is smiling face with smiling eyes Smiley: ""\N{smiling face with smiling eyes}") 😊
print("This is smiling face with halo Smiley: ""\N{smiling face with halo}") πŸ˜‡

😊EmojisπŸ™ƒ In Python Using Emoji Module:

To use this module first install emoji module on your machine by using below command

pip install emoji --upgrade

There are other ways too for installing this module checkout the official documentation here

After you install this module you just have to use it in your print statement for example

import emoji
print(emoji.emojize('Python is :thumbs_up:'))
print(emoji.emojize('Python is :bowtie:'))
print(emoji.emojize('Python is :laughing:'))
print(emoji.emojize('Python is :kissing_heart:'))
print(emoji.emojize('Python is :grinning:'))

You can choose your required emojis from this link
Checkout the git hub repo for full code here

So, did you find my content helpful? If you did or like my other content, feel free to buy me a coffee. Thanks.

Did you find this article valuable?

Support Dheeraj Choudhary by becoming a sponsor. Any amount is appreciated!

See recent sponsors |Β Learn more about Hashnode Sponsors
Β 
Share this