Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 769 Bytes

20220905131245.md

File metadata and controls

30 lines (24 loc) · 769 Bytes

Emojis

You want emojis in Python? Check out the emoji library (PyPI):

# pip install emoji
>>> import emoji
>>> emoji.emojize(":snake:")
'🐍'
>>> emoji.demojize('👍')
':thumbs_up:'

>>> [emo for name, emo in emoji.EMOJI_UNICODE.items() if 'Spain' in name]
['🇪🇸']

>>> from pprint import pprint as pp
>>> pp([(name, emo) for name, emo in emoji.EMOJI_ALIAS_UNICODE.items()
        if 'flag_for' in name])
[(':flag_for_Afghanistan:', '🇦🇫'),
 (':flag_for_Albania:', '🇦🇱'),
...
...
 (':flag_for_Zimbabwe:', '🇿🇼'),
 (':flag_for_Åland_Islands:', '🇦🇽')]

I also built a little tool to quickly find emojis from the command line and copy them to the OS clipboard: https://github.com/PyBites-Open-Source/emojisearcher

#emojis #tools