-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
29 lines (21 loc) · 843 Bytes
/
app.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
from flask import Flask, render_template, request, jsonify
import scheduler
app = Flask(__name__)
# Initial checklist items as an array
checklist_items = scheduler.prereq_chain.keys()
@app.route('/')
def index():
return render_template('index.html', checklist_items=checklist_items)
@app.route('/process_data', methods=['POST'])
def process_data():
selected_items = request.json['selected_items']
# Call your Python program with selected_items and get the result
result = process_items(selected_items)
return jsonify(result=result)
def process_items(selected_items):
# Your Python program logic here
# Example: concatenate selected items into a comma-separated string
result = ', '.join(scheduler.courseVisualizer(selected_items))
return result
if __name__ == '__main__':
app.run(debug=True)