Is there a way I can display a simple emoji character in my Python script using print? print('šŸ™„') gives me an error everytime | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Is there a way I can display a simple emoji character in my Python script using print? print('šŸ™„') gives me an error everytime

When I try to print an emoji, the Python script yields a "UnicodeEncodeError". Looking for a way around this.

5th Mar 2019, 3:09 AM
D. Booey šŸ“œ
D. Booey šŸ“œ - avatar
1 Resposta
+ 2
import sys, codecs sys.stdout = codecs.getwriter('utf_16')(sys.stdout.buffer, 'strict') print(chr(128580)) Your emoji is U+1F644 (base 16, ignore "U+", which equals 128580 (base 10). https://unicode.org/emoji/charts/full-emoji-list.html https://code.sololearn.com/csTae6tX7D4l/?ref=app
5th Mar 2019, 4:18 AM
Diego
Diego - avatar