text file to json python code example
Example 1: python write json to file utf8
open(jsonfile , "w", encoding="utf8").write(json.dumps(file,indent=4, ensure_ascii=False))
Example 2: save json file python
with open('data.txt', 'w') as outfile:
json.dump(data, outfile)