0

I have a simple Flask program as follows:

#!/usr/bin/env python

from flask import Flask
app = Flask(__name__)

@app.route('/')
def index():
    import datetime
    lines = """ 
    This is the index page
    <br>
    %s
    """%( datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") )
    return lines

But I would like the date to continue to update every second (without having to refresh the page). Is there a way to do this?

drjrm3
  • 4,474
  • 10
  • 53
  • 91

0 Answers0