2009-10-05 254 views
0

我刚开始学习谷歌应用程序引擎。Python - Google App Engine

当我在下面输入下面的代码时,我得到的只是“Hello world!” 我认为所需的结果是“你好,webapp世界!”

我错过了什么?我甚至尝试复制谷歌框架文件夹与我的应用程序在同一个文件夹中。

谢谢。

from google.appengine.ext import webapp 
from google.appengine.ext.webapp.util import run_wsgi_app 

class MainPage(webapp.RequestHandler): 
    def get(self): 
    self.response.headers['Content-Type'] = 'text/plain' 
    self.response.out.write('Hello, webapp World!') 

application = webapp.WSGIApplication(
            [('/', MainPage)], 
            debug=True) 

def main(): 
    run_wsgi_app(application) 

if __name__ == "__main__": 
    main() 

回答

5

正好运行此代码是否给我所需的输出。我怀疑你必须错误地运行一些其他代码,因为绝对有没有这种代码给出的方式可能会发出你观察到的。