save file python and read file json code example Example: python json save to file with open('output.json', 'w') as outfile: json.dump(data, outfile)