Try to search your question here, if you can't find : Ask Any Question Now ?

Python Return multiple variables after pause in function

HomeCategory: stackoverflowPython Return multiple variables after pause in function
Avatarpushpa asked 7 days ago

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”

Thanks

1 Answers
Best Answer
AvatarArben answered 7 days ago
Your Answer

9 + 12 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com