import streamlit as st
user_input = st.text_input("Enter a userID:")
# Check if user_input is an integer and not a string
if user_input.isdigit():
user_id = int(user_input)
st.write(f"Valid userID: {user_id}")
else:
st.write("Please enter a valid integer.")
It seems like I somehow resolve the problem, though I don’t know which steps work the magic. Now I can click “+” fast and up to 100 times and it won’t crash.
I had the same problem and I preferred to turn +/- off more than risking crashes.
I feel like the crash happens because streamlit performs a rerun every time you hit +/- buttons.
This is ok even if the code takes a long time to run, but…
if you press +/- buttons 100 times I suppose streamlit tries to perform 100 reruns at the same time, instead of running only the last instance.