我在python 3中有一个用于简单HelloWorld Web服务的代码:
from werkzeug.wrappers import Request, Response
@Request.application
def application():
return Response('Hello World!')
if __name__ == '__main__':
from werkzeug.serving import run_simple
run_simple('localhost', 4000, application)
我想在浏览器中对此进行测试...我试图打开url:“ http:// localhost:4000 / application ”,但它给出了错误“ 500”。怎么解决呢?
问题已解决。改变
def application():
至 def application(request):
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句