I’ve implemented this Python chat application by Saurabh Chaturvedi, to start learning about how networking works. The application is simple and makes use of the Tkinter module.
I’d like to extend the app's functionality by enabling users to type emoticons in the message box and have them rendered as emoji in the message list, when they send the messages. For example, if the user types ‘:)’ in the message box, it should render as .
So far, I've researched how to enable support for emoji in Tkinter applications. I came across Displaying emojis/symbols in Python using tkinter lib, but I don’t think it directly addresses my issue. I’m not sure if I’m currently going about solving this issue in the right way.
If it’s of any help, I’m running Windows 10 and using Python 3. And you should be able to implement the chat app by running the two scripts (server and client) described in Saurabh’s article. (Also, a potentially related problem is that emoji aren't displayed properly in my Python 3 interpreter. For example,
>>> import emoji
>>> print(emoji.emojize(":thumbs_up:"))
results in two question marks in boxes, rather than .)
Any suggestions on how I could enable emoji to be rendered in the message list?
EDIT:
As per @abarnert's comment below, it's worth mentioning that this problem did not originate from my trying to use the emoji library to translate a user’s ‘:)’ to emoji. Rather, the original question arose because I was unsure of how to go about carrying out the rendering of ‘:)’ as in a Tkinter-based app, in the first place.