@app.route('/ajax', methods=['GET', 'POST'])
def ajax_output():
if request.method == 'POST':
usd = usd_value()
euro = euro_value()
return jsonify(result=[usd, euro])
return render_template('Login.html')
<script src="http://code.jquery.com/jquery-1.5.min.js"></script>
<script>
function check(){
$.post("/ajax", {}, function(data){$("input[name='currency']").val(data)});
}
setInterval(check, 10000);
</script>
<input type="text" name="currency" readonly>