2017-07-14 78 views

回答

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() 
相關問題