this will print a lot of rows on web page
but when use ( *print(’\r{:.1f}MB/s - {:.1f}MB,total {:.1f}MB,left {:.0f} seconds '.format(print_params), end=’’) ) will only show one row result with dynamic change
How can streamlit only show one row with changing content?
Hi, @randyzwitch maybe my purpose was not clear before.
My meaning was, when I was not use streamlit, only run the example.py under local python environment.
code:
for i in content(a fake expression, as a cycle example):
** print_params=file_size-downloadsize/speed**
** print(’\r{:.1f}MB/s - {:.1f}MB,total {:.1f}MB,left {:.0f} 秒 '.format(print_params), end=’’)*
print_params is an expression that consisting of different parameters. different parameter’s value will change in a cycle period.
so the result is not a fixed string.
The result will show like this:
1.2MB/s - 4.6MB,total 3250.5MB,left 2636 seconds -------------one row, local time is 01:00
2.4MB/s - 40.5MB,total 3250.5MB,left 1349 seconds -------------same row, local time is 01:10
2.2MB/s - 48.5MB,total 3250.5MB,left 1335 seconds -------------same row, local time is 01:19
maybe a gif can express my purpose more well, but when I upload the file, platform told me there has some errors, it seems gif file is not supported by upload program.
so my purpose is use streamlit to show a information its content will change along with time change.
at the same time, different content is showed in fixed height range(same row)
I’m pretty sure the code example I posted is what you are describing. Re-using the same widget declared originally with the st.empty() line writes the content over the old content.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.