Search for '{{search_term}}'

Show Emoji in Python code

CMOS is the Code-Maven Open Source podcast that also includes video interviews. Subscribe to this feed RSS feed with your Podcast listener app or via iTunes iTunes.

Tons of web site and applications allow the use of Emoji. There is even an Emoji cheat sheet to show the available Emojis. Wikipedia explains that some of the Emoji were standardized as Unicode characters.

There is a Python module, surprisingly called emoji that allows us to include Emoji in Python based applications. A simple example would look like this:


import emoji

print(emoji.emojize('Python is :thumbs_up_sign:'))
print(emoji.emojize('Python is :cookie:'))

And the output looks like this:

Python is 👍
Python is 🍪


In the comments, please wrap your code snippets within <pre> </pre> tags and use spaces for indentation.
comments powered by Disqus