Vish2005 commited on
Commit
d112e03
·
1 Parent(s): 057fc04

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -0
app.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ from queue import PriorityQueue
4
+
5
+ from datetime import datetime
6
+
7
+ pq = PriorityQueue(maxsize = None)
8
+
9
+ date_format = '%m-%d-%Y'
10
+
11
+ def add_elem(date_str, item_name):
12
+
13
+ cur_date = datetime.strptime(date_str, date_format)
14
+
15
+ pq.push((cur_date, item_name))
16
+
17
+ return pq
18
+
19
+ def pop():
20
+
21
+ pq.get()
22
+
23
+ return pq
24
+
25
+
26
+ iface = gr.Interface(
27
+ fn=add_elem,
28
+ inputs=["text", "text"],
29
+ outputs="text",
30
+ title="Add Work",
31
+ description="Enter Date in MM-DD-YYYY and Name of Assignment",
32
+ )
33
+
34
+ iface.launch()
35
+