-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
30 lines (27 loc) · 698 Bytes
/
app.py
File metadata and controls
30 lines (27 loc) · 698 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
30
from flask import Flask, request, render_template
import knapsack
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
jumlah_tugas = request.form['jumlah_tugas']
nama_tugas = request.form['nama_tugas']
skala_prioritas = request.form['skala_prioritas']
waktu_pengerjaan = request.form['waktu_pengerjaan']
waktu = request.form['waktu']
return render_template(
'index.html',
data= knapsack.kalkulasi(
jumlah_tugas,
nama_tugas,
skala_prioritas,
waktu_pengerjaan,
waktu
)
)
return render_template(
"index.html",
data=""
)
if __name__ == "__main__":
app.run()