Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
This is a simple todo list app that allows you to add, remove, and mark tasks as complete.
|
3 |
+
All actions are performed on the client side.
|
4 |
+
"""
|
5 |
+
import gradio as gr
|
6 |
+
|
7 |
+
tasks = ["Get a job", "Marry a rich person", "", "", "", ""]
|
8 |
+
textboxes = []
|
9 |
+
rows = []
|
10 |
+
|
11 |
+
with gr.Blocks() as demo:
|
12 |
+
gr.Markdown("# A Simple Interactive Todo List")
|
13 |
+
for i in range(6):
|
14 |
+
with gr.Row() as r:
|
15 |
+
t = gr.Textbox(tasks[i], placeholder="Enter a task", show_label=False, container=False, scale=7, interactive=True)
|
16 |
+
b = gr.Button("✔️", interactive=bool(tasks[i]))
|
17 |
+
t.change(lambda : gr.Button(interactive=True), None, b)
|
18 |
+
b.click(lambda : gr.Row(visible=False), None, r)
|
19 |
+
|
20 |
+
# Add a button to add a new task
|
21 |
+
|
22 |
+
|
23 |
+
demo.launch()
|