簡體   English   中英

Python-Google App引擎

[英]Python - Google App Engine

我剛剛開始學習Google App Engine。

當我在下面輸入以下代碼時,我得到的只是“ Hello world!”。 我認為理想的結果是“您好,webapp世界!”

我想念什么? 我什至嘗試將google framework文件夾復制到與我的應用程序相同的文件夾中。

謝謝。

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()

准確地運行此代碼不會給我所需的輸出。 我懷疑你必須運行錯誤一些其他的代碼,因為有絕對沒有辦法驗證碼給出可能可能發出你觀察到的東西。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM