我读了一些教程却没有得到启发。有人能告诉我这里出了什么问题吗?
我还想知道如何在类中定义mytest1这样的东西,然后在函数中访问它?
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class MainPage(webapp.RequestHandler):
#mytest1 = "test1"
#Runtime failure on this line talking about an indent issue
def get(self, test = 'testing!'):
mytest2= "test2" #Runtime failure on this line talking about an indent issue
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, webapp World!\n')
self.response.out.write(self)
#self.response.out.write('\n' + mytest1)
self.response.out.write('\n' + mytest2)
application = webapp.WSGIApplication(
[('/', MainPage)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()