Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

importing emoji codes into jupyter notebooks

Jupyter notebooks support markdown cells however it doesn't seem to support emoji codes. I suppose one way might be using html to import icons like fontawesome

Anyone have a workaround?

Edit: asked directly on the jupyter Github #2199

like image 944
Constantino Avatar asked Feb 16 '17 16:02

Constantino


People also ask

How do you import Emojis into Python?

Emojis can also be implemented by using the emoji module provided in Python. To install it run the following in the terminal. emojize() function requires the CLDR short name to be passed in it as the parameter. It then returns the corresponding emoji.

How do I add codes to my Jupyter Notebook?

Press Esc key, type m for markdown cell, press Enter key. The cursor is now in the markdown cell waiting for instructions. Type your code or paste a code block.

How do I download an emoji module in Python?

Emoji Module: Installation First, we have to open the command prompt terminal shell in the system, and then we have to use the following pip command to install Python Emoji Module through a pip installer: pip install emoji.

How do you add a CSS to a Jupyter Notebook?

To apply the CSS style to all the notebooks, create the file ~/. jupyter/custom/custom. css and add the styles there.


1 Answers

Install emoji package:

pip install emoji --upgrade

then :

import emoji
print(emoji.emojize('Hi there! :revolving_hearts:'))

output:

Hi there! 💞

like image 110
Shruti Mehta Avatar answered Sep 23 '22 08:09

Shruti Mehta