# saving a text file
with open("file_name.txt", "w") as output:
output.write(str(content))
# saving a json file
import json
with open('file_name.json', 'w') as f:
json.dump(content, f)
import json
# Opening JSON file
f = open('file_name.json',)
# returns JSON object as a dictionary
data = json.load(f)