我尝试了两种不同的方式在GAE中将输出刷新到浏览器:

from time import sleep
import sys;
print ""
print "Output"
sys.stdout.flush()
sleep(10)

以及:
from time import sleep
self.response.out.write("Output")
self.response.out.flush()
sleep(10)

最佳答案

无法将输出刷新到浏览器。当处理程序返回时,应用程序引擎会立即发送整个响应。
参考:http://code.google.com/appengine/docs/python/runtime.html#Responses

10-07 13:19
查看更多