marseymoji/marsey/convert_filename.py

10 lines
285 B
Python

def emoji_to_filename(emoji):
code_points = [format(ord(char), 'x') for char in emoji if ord(char) != 0xfe0f]
filename = '_'.join(code_points)
return 'emoji_u' + filename + '.png'
emoji = input("copy-paste an emoji: ")
filename = emoji_to_filename(emoji)
print(filename)