Here is how I dump a file
with open(\'es_hosts.json\', \'w\') as fp: json.dump(\',\'.join(host_list.keys()), fp)
The results is
Use python's built-in string replace function
with open('es_hosts.json', 'w') as fp: json.dump(','.join(host_list.keys()).replace('\"',''), fp)