< Server-Side Scripting < Introduction
app.py
# Displays "Hello world!"
#
# References:
# https://en.wikiversity.org/wiki/Flask/Hello_World
import flask
app = flask.Flask(__name__)
@app.route('/')
def show_root():
return "Hello world!"
if __name__ == "__main__":
app.run(host='0.0.0.0', port=5000)
Try It
Copy and paste the code above into the following free online development environment or use your own Python (Flask) compiler / interpreter / IDE.
See Also
This article is issued from Wikiversity. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.