时间:2021-07-01 10:21:17 帮助过:36人阅读
使用Flask框架的简单入门范例代码,如果你正学习Flask框架,可以参考下面的启动代码,这段代码可以在网页上输出“hello world”
import os # Using Flask since Python doesn't have built-in session management from flask import Flask, session app = Flask(__name__) # Generate a secret random key for the session app.secret_key = os.urandom(24) @app.route('/') def index(): return "Hello world" if __name__ == '__main__': app.run( host="0.0.0.0", port=int("80") )
希望本文所述对大家的Python程序设计有所帮助。