As Python 3 is now more Unicode-friendly, I’m getting more and more enquiries about using EasyGui with Unicode.
First, of course, folks are interested in using EasyGui to display messages in non-Latin character sets. They are interested in whether EasyGui can display Unicode, and also in what tools are available for writing Python code that contains Unicode text.
In addition, there is interest in getting user input in non-Latin character sets. Some developers are interested in support for bidirectional (“bidi”) languages such as Hebrew and Arabic, which normally read from right to left but allow the embedding of left-to-right text for things like numbers and quotations from left-to-right languages. It was in connection with bidi languages that I recently posted on how to reverse a string in Python 3.
EasyGui uses Tkinter (which uses Tk and Tcl) for its graphical displays. (Tkinter and Tk are included in the standard Python distribution, which is why EasyGui uses Tkinter.) So questions about EasyGui’s Unicode capabilities are essentially questions about Tkinter’s (and Tk’s) Unicode capabilities.
Unfortunately, the news about Tkinter’s Unicode capabilities is not good. Tk and Tcl weren’t designed with Unicode in mind, and certainly not with Unicode data entry in mind.
Tkinter (and therefore Easygui) can display non-Latin Unicode characters if they are sent in from a calling application. The problem here is how to write the Python code for the application. One person I know uses the gedit editor on Linux to do it; it seems that gedit has pretty good Unicode support.
I don’t know about Unicode support in the popular Python IDE’s. This post suggests that SPE might provide support for Unicode. (If you have information about Python IDEs and their support for Unicode, it would be great if you could comment on this post with that information.)
But entering user input into Tkinter and EasyGui is a problem. As far as I know, there is no way to tell a Tkinter data-entry widget about the incoming encoding. So about the best you can do is to use (say) gedit to create the text that you want, and then copy and paste the text into the EasyGui data-entry widget. Needless to say, this is highly unsatisfactory.
According to this post, as of 2008-07-03 “Tk has no bidi facilities yet”. So Tk, and therefore Tkinter, and therefore EasyGui, do not support bidi languages, and it doesn’t appear likely that bidi support will be coming any time soon. So Arabic and Hebrew users are just plain out of luck.
I’d like to be able to tell you which Python GUI packages do provide good Unicode support; then I could recommend wxPython or PyQT or something as an alternative to EasyGui. But I honestly don’t know about the level and quality of Unicode support in other GUI packages. (If you have information on this topic, it would be great if you could comment on this post with that information.)