-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththermometer.py
34 lines (27 loc) · 927 Bytes
/
thermometer.py
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
30
31
32
33
34
import random
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/', methods=["GET"])
def index():
return render_template('index.html', title='偽装体温計')
@app.route('/normal', methods=["GET"])
def normal():
ten = 3
one = 6
point = random.randint(0,7)
pic = random.choice(['thermo','thermo2','thermo3'])
return render_template('normal.html', title='平熱体温計', ten=ten, one=one, point=point, pic=pic)
@app.route('/fake', methods=["GET"])
def fake():
ten = 3
one = random.choice([7,8,9])
if one == 7:
point = random.randint(5,9)
elif one == 9:
point = random.randint(0,3)
else:
point = random.randint(0,9)
pic = random.choice(['thermo','thermo2','thermo3'])
return render_template('fake.html', title='仮病体温計', ten=ten, one=one, point=point, pic=pic)
if __name__ == "__main__":
app.run(debug=True)