Using emojis in Python

Asked

Viewed 2,688 times

0

Hello. I’m trying to use emojis in Python (version 3.7.3) but the image of emoji does not appear. I use Vscode (version 1.33.0) and installed the 'emoji' module via pip and import, but the image that appears is a diamond with a question mark.

Has anyone ever had that kind of problem?

import emoji

print(emoji.emojize('Python is :thumbs_up:',use_aliases=True))

inserir a descrição da imagem aqui

  • 3

    And your terminal has support for displaying emojis?

  • You can use repl.it to test: https://sopt-373823using emojis-em-python.acwoss.repl.run

  • 1

    The language there is doing the right thing - the problems are that (1) the application you are using to see the output or (2) no source in the system - has support for the desired emojis. The deal is to see if lib emoji itself has suggestions on how to set this up in windows.

  • With the windows-store "terminal" application - the CMD replacement that microsoft is preparing in recent years should work. (the only windows I have access to is on a corporate intranet and I can’t confirm)

1 answer

-1

Hello, in python3.x it is possible to print emojis in using Pip or external libraries. You enter the link below and copy the code that is in the Unicode column and in your python script vc cola and replace the '+' by '000'

#original : U+1F601 #modified: U0001F601

print(' U0001F601')

https://apps.timwhitlock.info/emoji/tables/unicode

  • 2

    Yes - basically what emoji lib does is to change the sequence ":thumbs_up:" in the string to the single character - which is what you put. This would not solve the problem in the question - what happens is that the terminal he uses has no emoji support - or he has no source in the system with that character.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.