An event loop keeps a web server available without an explicit application loop. It waits for network events, such as HTTP requests, then dispatches them for processing while remaining mostly idle between events. section 6.4.2
A Flask server waiting for requests
Running a Flask app starts an event loop that monitors port 5000. A request for / calls home() and returns “Hello World”; a request for /something receives a 404 response while the server continues running. section 6.4.2
from flask import Flask #1
app = Flask(__name__) #2
@app.route("/") #3
def home(): #4
return "Hello World!"
Inspect the minimal Flask application whose route is dispatched by the server event loop. section 6.4.2










