I am trying to Implement a pause and resume button in my program.
But I get the error: DuplicateWidgetID: There are multiple identical st.button widgets with key='pause_button' . How do I fix this when there are no duplicate keys?
Here is a snipnet of my code:
while st.sidebar.button(label="Pause", key='pause_button'):
if st.sidebar.button(label="Resume", key='resume_buton'):
continue
time.sleep(10)
Or what is best way to implement a pause button in my simulation program?
As per my understanding, you are trying to create multiple pause button with same key. my solution to you is to change the keys like pause1_button, pause2_button. here your functionality will not affecting anyways.