I have following problem:
I have a function that displays text with st.write every 2 seconds. Now I want to only show the 5 most recent messages. My current code will fill the page to the bottom until the program is finished.
Let’s suppose my program counts integers:
Current situation: …7…8…9…10…11…12…13 …14…Finished
Desired output: (only shows the 5 most recent integers and erases old ones) …
7…8…9…10…11
(erase output)
8…9…10…11…12
(erase output)
9…10…11…12…13
(erase output)
10…11…12…13…14
Finished
How can I solve this programmatically? How can I erase the output?