Skip to content

Instantly share code, notes, and snippets.

@ericchiang
Created October 14, 2014 21:17
Show Gist options
  • Save ericchiang/7bf5e3837ad22d555332 to your computer and use it in GitHub Desktop.
Save ericchiang/7bf5e3837ad22d555332 to your computer and use it in GitHub Desktop.
Flask hello world
import sys
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
try:
port = int(sys.argv[1])
except:
print "No port specified, reverting to 8888"
port = 8888
app.run(port=port)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment