While loop workaround

For example, this terminates:

import streamlit as st
import time

x = 0

p = st.empty()

while x < 10:
    p.write(f"Your value is {x}")
    time.sleep(1)
    x += 1
1 Like