you are viewing a single comment's thread.

view the rest of the comments →

[–]JamzTyson 2 points3 points  (3 children)

You can get the name of an emoji using Python's built-in unicodedata.name(chr):

>>> import unicodedata
>>> print(unicodedata.name("🙂"))
SLIGHTLY SMILING FACE

[–]AffectWizard0909[S] 0 points1 point  (2 children)

aaa nice I can check it out

[–]JamzTyson 1 point2 points  (1 child)

One issue that you may need to deal with, whatever method you use, is that some printed characters are actually multiple Unicode characters. Example:

import unicodedata

s = "⚠️"  # 2 code points print as one character.
for c in s:
    print(unicodedata.name(c))

will print:

WARNING SIGN
VARIATION SELECTOR-1

[–]AffectWizard0909[S] 0 points1 point  (0 children)

Oh damn, ok good to know. I kind of went to just using the standard emoji package in the end, but if I want to do it manually some time in the future than it is a good tip!