import codesimport jsondef write_json(self,result,json_name): with codecs.open(json_name, "w", "utf-8") as f: j = json.dumps(result, indent=4, ensure_ascii=False) f.write(j)