Skip to content
Snippets Groups Projects
Commit f95406bb authored by gsingh58's avatar gsingh58
Browse files

lec21 updated

parent f176072d
No related branches found
No related tags found
No related merge requests found
......@@ -14,10 +14,18 @@ last_visit = 0 # TODO: dict of visit times, for each IP
# TODO: write code for creating a page for time.html
# TEMPLATE semi-static / semi-dynamic
@app.route("/time.html")
def clock():
with open("time.html") as f:
s = f.read()
s = s.replace("REPLACE_ME", str(time.time()))
return s
# TODO: create a dynamic page ha.html
# DYNAMIC
@app.route("/ha.html")
def laugh():
return "ha "*1000
# STATIC
# @ operator is called a "decorator"
......
......@@ -24,9 +24,18 @@ last_visit = 0 # TODO: dict of visit times, for each IP
# TODO: write code for creating a page for time.html
# TEMPLATE semi-static / semi-dynamic
@app.route("/time.html")
def clock():
with open("time.html") as f:
s = f.read()
s = s.replace("REPLACE_ME", str(time.time()))
return s
# TODO: create a dynamic page ha.html
# DYNAMIC
@app.route("/ha.html")
def laugh():
return "ha "*1000
# STATIC
# @ operator is called a "decorator"
......
This diff is collapsed.
File added
File added
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment