Assume if I want to do a simple loop and I will take some time to execute it.
for i in range(0, 100000000000):
print i
Now, here is the code for Bottle which I have. I want to print out all the intermediate output like 1,2,3,4... before the loop ends.
import bottle
@bottle.route('/')
def home_page():
total = 0
for i in range(0, 100000000000):
total = i + 0
print i
return bottle.template('hello.tpl', {"total": total})
How can I output i during iteration? I tried "response" but it didn't work, it still have to return anyway.