import streamlit as st
import functions
list = functions.get_list()
def add_todo():
todo = st.session_state["new_todo"] + "\n"
list.append(todo)
functions.write_list(list)
st.title("Simple To-Do app")
st.subheader("This is my todo app")
st.write("Increase your productivity")
for todo in list:
st.checkbox(todo)
st.text_input(label = "", placeholder = "Add a new todo...",
on_change=add_todo, key = 'new_todo')
When a widget is created, it's assigned an internal key based on its structure. Multiple widgets with an identical structure will result in the same internal key, which causes this error.
To fix this error, please pass a unique key
argument to st.checkbox
.
Traceback:
File "C:\Users\seraf\Desktop\Final project\web.py", line 17, in <module>
st.checkbox(todo)