Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 Python 编程的新手。我想以我的语言(泰语)将数据存储在 json 文件中,然后读取它以在 Tkinter gui 中显示。是否有任何 Python 包可以帮助像我自己一样读/写亚洲语言?
如果您使用的是 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()