使用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) # Define a route for the webserver ,http://www.75271.com @app.route('/') def index(): return "Hello world" if __name__ == '__main__': app.run( host="0.0.0.0", port=int("80") )