I am writing a program that stores data in a dictionary object, but this data needs to be saved at some point during the program execution and loaded back into the dictionar
If in Chinses
import codecs fout = codecs.open("xxx.json", "w", "utf-8") dict_to_json = json.dumps({'text':"中文"},ensure_ascii=False,indent=2) fout.write(dict_to_json + '\n')