4

I am making a p2p chat program in Python 3 using Tkinter. I can paste Korean text into the Entry widget and send to the other user and it works.

However, I can't 'type' Korean into the widget directly.

Why is this happening?

I am using Mac OS X Yosemite.

Cœur
  • 37,241
  • 25
  • 195
  • 267
whiteSkar
  • 1,614
  • 2
  • 17
  • 30
  • 2
    tkinter 8.5 had this problem, update it to 8.6 – m0bi5 Nov 09 '15 at 06:19
  • ActiveState tcl/tk 8.5.18 should work. See https://www.python.org/download/mac/tcltk/. 8.6 will not work with the PSF distributed python. – Terry Jan Reedy Nov 11 '15 at 20:47
  • @whiteSkar is this resolved? – Hippolippo Jan 22 '18 at 17:28
  • @Hippolippo I haven't tried updating my tkinter to 8.6 so my problem hasn't been resolved (decided not to support Korean) but I would assume the first comment is the solution I would accept if it was not a 'comment' but an 'answer'. – whiteSkar Apr 09 '18 at 07:35
  • @Hippolippo Just upgraded my python version to 3.8 to have tkinter 8.6. Confirmed that the problem is resolved! – whiteSkar May 16 '20 at 08:05

2 Answers2

0

I would recommend using the translate module by pip install translate into your python shell. It uses google translate offline as a python module. It would work something like this: $ translate-kor -t zh "This is a pen."

More details on translate can be found at the link https://pypi.org/project/translate/.

Once you have this, you can probably integrate it into your chat program, as you could easily save the translation to a variable. This is a viable alternative if you are not able to update your tkinter python module.

0

As mentioned by @mohit-bhasi, upgrading my python version to 3.8 which has tkinter 8.6 in it solved the problem. I can now type Korean directly into the widgets.

Only caveat is that I need to press right arrow once when I finished typing to have the last letter appear. Otherwise, the last letter is not recognized.

whiteSkar
  • 1,614
  • 2
  • 17
  • 30