Python to Javascript JSON objects (Flask) [duplicate]
问题 This question already has answers here : JavaScript raises SyntaxError with data rendered in Jinja template (3 answers) Closed 2 years ago . I am trying to create a simple Flask app where an array of integers is generated on the server and sent to the client. I want to view the array of integers in the console. Here is some sample (working) code in app.py: from flask import Flask, render_template, request, url_for import random, json app = Flask(__name__) @app.route('/', methods=['GET']) def