Emoj's in python | How to create emojis on python?



Emoj's in python | How to create emojis on python?


There are multiple ways we can print the Emojis in Python. Let’s see how to print Emojis with Unicode, CLDR names and emoji module.
Using Unicode: 
Every emoji has a Unicode associated with it. Emojis also have a CLDR short name, which can also be used.
From the list of Unicode, replace “+” with “000”. For example – “U+1F600” will become “U0001F600” and prefix the Unicode with “\” and print it.

# grinning face
print("\U0001f600")
  
# grinning squinting face
print("\U0001F606")
  
# rolling on the floor laughing
print("\U0001F923")
Output:





Using CLDR short name
# grinning face
print("\N{grinning face}")
  
# slightly smiling face
print("\N{slightly smiling face}")
  
# winking face
print("\N{winking face}")
Output:

Using emoji module:
Emojis can also be implemented by using the emoji module provided in Python. To install it run the following in the terminal.
pip install emoji
emojize() function requires the CLDR short name to be passed in it as the parameter. It then returns the corresponding emoji. Replace the spaces with an underscore in the CLDR short name.
# import emoji module 
import emoji
  
  
print(emoji.emojize(":grinning_face_with_big_eyes:"))
print(emoji.emojize(":winking_face_with_tongue:"))
print(emoji.emojize(":zipper-mouth_face:"))
Output:


demojize() function converts the emoji passed into its corresponding CLDR short name.

Below is a list of some common emoji Unicode with their CLDR short names:
CLDR SHORT NAMEUNICODE
grinning faceU+1F600
grinning face with big eyesU+1F603
grinning face with smiling eyesU+1F604
beaming face with smiling eyesU+1F601
grinning squinting faceU+1F606
grinning face with sweatU+1F605
rolling on the floor laughingU+1F923
face with tears of joyU+1F602
slightly smiling faceU+1F642
upside-down faceU+1F643
winking faceU+1F609
smiling face with smiling eyesU+1F60A
smiling face with a haloU+1F607
smiling face with 3 heartsU+1F970
smiling face with heart-eyesU+1F60D
star-struckU+1F929
face blowing a kissU+1F618
kissing faceU+1F617
smiling faceU+263A
kissing face with closed eyesU+1F61A
kissing face with smiling eyesU+1F619
face savoring foodU+1F60B
face with tongueU+1F61B
winking face with tongueU+1F61C
zany faceU+1F92A
squinting face with tongueU+1F61D
money-mouth faceU+1F911
hugging faceU+1F917
face with hand over mouthU+1F92D
shushing faceU+1F92B
thinking faceU+1F914
zipper-mouth faceU+1F910
face with raised eyebrowU+1F928
neutral faceU+1F610
expressionless faceU+1F611
face without mouthU+1F636
smirking faceU+1F60F
unamused faceU+1F612
face with rolling eyesU+1F644
grimacing faceU+1F62C
lying faceU+1F925
relieved faceU+1F60C
pensive faceU+1F614
sleepy faceU+1F62A
drooling faceU+1F924
sleeping faceU+1F634
face with medical maskU+1F637
face with thermometerU+1F912
face with head-bandageU+1F915
nauseated faceU+1F922


Post a Comment

0 Comments