We have a local application that runs an animation on a canvas in tkinter. Would it be possible to run such a program in the cloud with streamlit.io and show the animation on the client side?
If so, how?
This question was asked 15 days ago but sofar no single response.
Also if it is not possible we would like to know, anybody able to assist with this?
It’s the same answer as I gave last time. Tk is a desktop GUI. When you host an app anywhere but your local machine, you are not able to access that server’s desktop, just the information displayed through the browser. So the only workaround is to use something other than Tk to create your popup and have that information be passed through the browser.
Hi @randyzwitch thanks for your response
I cannot recall anybody responding previously but I might have missed it Do you have any suggestions what GUI works with Streamlit to display simple 2D moving objects? Its acctually this python library we want to run on Streamlit : https://www.salabim.org/ , its a (Python) Discrete Event Simulation library that supports 2D animations which run on a Tkinter canvas and we would really like to make this work in Streamlit
I don’t know anything about this domain, but from their documentation, it appears that generating videos is a possibility. If so, you could possibly create a video, then use the provided st.video to display the video:
Thanks Randy (e.o),
I think you are correct, this is probably the only solution.
I initially ran into the issue that Streamlit needs H264 codec but with a work around I managed to run a simple demo animation as a video when running it my own browser (even though still got an error message with fall back solution at the command prompt.
But deploying it on Streamlit is not working it gives an error and now I am really stuck.
I have attached below links
Would you be able to assist? , does Streamlit accept other video formats? I tried .avi but that failed.
I just found a way to at least show and deploy the app now with the animation as a animated gif following this thread: How to show local gif image? - #4 by randyzwitch , however video still has my preference (by far!!) but just in case we cannot get it to work…
Remember that streamlit actually comes with a built-in screen recorder, accessible from the burger menu top right when viewing an app. This can be used to record anything on screen - it doesn’t have to be the actual streamlit app itself.
And then just display as a video, per the above suggestion.
Sadly this can’t then be interactive, of course.
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.