I am looking to figure out how I can pretty print a json file when I return it in a flask function. I have managed to pretty print it using json.dump but not with the flask function. this is what I have":
from flask import Flask, jsonify
import flask
import json
app = Flask(__name__)
with open('VO/IFATC EG/qotd.json') as qotd_file:
data = json.load(qotd_file)
rr = data['questions']
car = json.dumps(data, indent=4)
print(car)
@app.route('/')
def words():
return json.dumps(data, indent=4)
app.run()
it prints car but I just get
Thanks
