A simple question but I couldn’t find the answer anywhere. Probably solved quickly if you know Streamlit:
I want to work on a list of images. For every image I need to do some operations on screen through the Streamlit app, then click on the Next button and proceed with the next image.
But I just can’t setup my next/previous navigation through the list with buttons. When I click my Next button, the file_index increases as expected, but a following attempt to click the Next button doesn’t have any effect.
I think it’s the way Streamlit automatically recalculates everything that has changes, and therefore also my initiating statement “file_index=0”. If I add other widgets to my app and click on them while running, the file_index=0 seems to executed as well. But I’m not sure how to tackle this. Should I tackle this using the cache settings?
Simplified code (no images, no operations, just the buttons and the displaying of the resulting item from the list:
import streamlit as st
placeholder1 = st.empty()
placeholder2 = st.empty()
Thanks for any helpful suggestion on how to navigate through a list without restarting at the begin!