External Exam Download Resources Web Applications Games Recycle Bin

Hello Flask

webserver.py

from flask import *
app = Flask("My first web app")

@app.route("/")
def main():
    return "hello world"
  
app.run()

Launch with a .bat file to keep the command prompt window on-screen if your server crashes:

cmd /k python webserver.py


With your server running (double-click the batch file), navigate to the loopback IP address: http://127.0.0.1:5000/