print 'Content-Type: text/html; charset=UTF-8'
print ''
print '<html><meta http-equiv="refresh" content="0;url=/index.html"></html>'
第二段代码
import wsgiref.handlers
import os
from google.appengine.ext import webapp
class MainPage(webapp.RequestHandler):
def get(self):
path = os.path.join(os.path.dirname(__file__), 'index.html')
f=open(path)
self.response.out.write(f.read())
f.close()
def main():
application = webapp.WSGIApplication([('/', MainPage)],debug=True)
wsgiref.handlers.CGIHandler().run(application)
if __name__ == "__main__":
main()
为什么一个起作用一个不起作用(本地测试),复杂的那个起作用了。
print ''
print '<html><meta http-equiv="refresh" content="0;url=/index.html"></html>'
第二段代码
import wsgiref.handlers
import os
from google.appengine.ext import webapp
class MainPage(webapp.RequestHandler):
def get(self):
path = os.path.join(os.path.dirname(__file__), 'index.html')
f=open(path)
self.response.out.write(f.read())
f.close()
def main():
application = webapp.WSGIApplication([('/', MainPage)],debug=True)
wsgiref.handlers.CGIHandler().run(application)
if __name__ == "__main__":
main()
为什么一个起作用一个不起作用(本地测试),复杂的那个起作用了。
