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)