问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/33603442/python-tkinter-entry-i-cant-type-korean-in-to-the-entry-field