I have found a piece of flask: https://github.com/pratik55/Python-Flask-dynamic-update- code that dynamically updates the HTML, but it requires a function like time.time() – it outputs, pauses, and outputs again. I would like a custom function to do just this but not with a time value.
I tried something similar to this https://www.geeksforgeeks.org/g-fact-41-multiple-return-values-in-python/ but I could not put a pause in between each output.
The flask code looks like this:
from flask import Flask, jsonify, render_template, request import webbrowser import time app = Flask(__name__) @app.route('/_stuff', methods = ['GET']) def stuff(): return jsonify(result=time.time()) @app.route('/') def index(): return render_template('dy1.html') if __name__ == '__main__': app.run()
The result is just a question mark when I replace result=time.time() with something else unless its very explicit like result=”hello”