-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhello.py
More file actions
30 lines (22 loc) · 723 Bytes
/
hello.py
File metadata and controls
30 lines (22 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from flask import Flask
from flask import request
import json
"""
1. install anaconda python in your account
2. Create etc/conf.json from the etc/conf-template.json
2. Run as: python hello.py
3. Put in your web browser: http://<host>:<port>
Of course you need to have access to the host, so you need to be behind the firewall or run VPN
"""
conf = json.load(open('etc/conf.json'))
host = conf['host']
port=conf['port']
debug = conf['debug'] in ['T' 'True' 't' 'true']
app = Flask(__name__)
print 'Hello, World!'
@app.route('/')
def hello_world():
print 'hello console output'
return 'hello web browser'
# use debug false when running on host other than localhost
app.run(host=host, debug=debug, port=port)