Created
September 26, 2014 04:39
-
-
Save atmb4u/acee78f13bebec000681 to your computer and use it in GitHub Desktop.
basic helloworld in flask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import Flask object from flask library | |
# you can install flask by pip install flask | |
from flask import Flask | |
# initialize Flask app with the name of the file | |
app = Flask(__name__) | |
# define the url for which the application should send an http response to | |
@app.route('/') | |
# plain python function to handle the request | |
def hello_world(): | |
# expected return from the function for the request (to the browser) | |
return "Hello World!" | |
# executed the above defined Flask app | |
if __name__ == '__main__': | |
# initialize the app by invoking the Flask function run() | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment