-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy pathtodo_app.py
More file actions
38 lines (28 loc) · 744 Bytes
/
todo_app.py
File metadata and controls
38 lines (28 loc) · 744 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
31
32
33
34
35
36
37
38
import streamlit as st
st.markdown(
"""
<style>
.stApp{
background-color: #ff0015;
}
</style>
""",
unsafe_allow_html=True
)
st.title("TO-DO LIST app ")
task= st.text_input("Enter your task",)
if "tasks" not in st.session_state:
st.session_state.tasks =[]
if st.button("Add task"):
if task:
st.session_state.tasks.append(task)
else:
st.warning("Please Add a task")
completed_task=[]
for i, task in enumerate(st.session_state.tasks):
col1, col2 =st.columns([0.7, 0.3])
with col1:
st.checkbox(task, key= f"task{i}")
with col2:
if st.button('X', key=f"delet_{i}"):
st.session_state.tasks.pop(i)