Flushing the output in GAE?
I have tried two different ways of flushing the output to the browser in GAE:
from time import sleep
import sys;
print ""
print "Output"
sys.stdout.flush()
sleep(10)
And:
from time import sleep
self.response.out.write("Output")
self.res开发者_如何学JAVAponse.out.flush()
sleep(10)
You can't flush the output to the browser. App Engine sends the entire response all at once when your handler returns.
Reference: http://code.google.com/appengine/docs/python/runtime.html#Responses
精彩评论