from bottle import route, run, redirect
import datetime
def time_to_string(hour):
datefile = open('rediects-by-hours.txt').readlines()
return datefile[hour]
@route('/')
def index():
now = datetime.datetime.now()
return redirect(time_to_string(now.hour))
run(host='localhost', port=8080)
return datefile[hour].strip()