1 个回答
✓ 已被采纳
# -*- coding: utf-8 -*-

import web

urls = ('/', 'Hello')

class Hello(object):
    def GET(self):
        return 'Hello world'

app = web.application(urls, globals())


from wsgiref.simple_server import make_server

if __name__ == '__main__':
    server = make_server('0.0.0.0', 8080, app.wsgifunc())
    server.serve_forever()

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏