Python Tkinter Entry. I can't type Korean in t

2019-05-09 10:08发布

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条回答
冷血范
2楼-- · 2019-05-09 10:16

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.

查看更多
登录 后发表回答