0

我是 Python 编程的新手。我想以我的语言(泰语)将数据存储在 json 文件中,然后读取它以在 Tkinter gui 中显示。是否有任何 Python 包可以帮助像我自己一样读/写亚洲语言?

4

1 回答 1

0

如果您使用的是 python 3,则可以读/写 unicode。

例如

with open('path\to\file.json', 'r', encoding='utf-8') as f:
    data = f.read()

from Tkinter import *
tk = Tk()
txt = Text(tk)
txt.pack()
txt.insert('1.0', data )
tk.mainloop()
于 2017-07-14T10:05:53.433 回答