在GAE中如何刷新输出?
我尝试了两种不同的方法来将输出发送到浏览器,在谷歌应用引擎(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)
1 个回答
4
你不能把输出直接发送到浏览器。App Engine 会在你的处理程序返回时一次性发送整个响应。
参考链接:http://code.google.com/appengine/docs/python/runtime.html#Responses