flask
Posted kakawith
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了flask相关的知识,希望对你有一定的参考价值。
1,werkzeug
from werkzeug.wrappers import Request,Response from werkzeug.serving import run_simple def run(environ,start_response): return [b‘Hello,World‘] if __name__ ==‘__main__‘: run_simple(‘localhost‘,4000,run)
from werkzeug.wrappers import Request,Response @Request.application def hello(request): return Response(‘Hello World!‘) if __name__ ==‘__main__‘: from werkzeug.serving import run_simple run_simple(‘localhost‘,4000,hello)
from flask import Flask app = Flask(__name__) @app.route(‘/index‘) def index(): return "Hello World" if __name__ ==‘__main__‘: app.run()
以上是关于flask的主要内容,如果未能解决你的问题,请参考以下文章