Just one point, in my case the <link> or loading from network using js does indeed work. the only case when it does not is if I try to access the network from inside the stlite script.
For example, this code works fine with Github pages, even though it requests the network: <link type="text/css" rel="stylesheet" href="../src/styles.css">
In this case, is there any way to read the file that was loaded in the html header from stlite ? (for example in this case reading that styles.css file)
A bonus question:
Wouldnāt be nice to be able to use separately defined python files instead of including all the files in the html file ?
for example:
Very interesting.
I wonder, is it possible to do object tracking solution that could work on top of stlite?
Smooth video UX is not so important for this app, but Iād like to make nearly real time calculation of objects and object co-ordinates in the webcam video frame.
@pahotari Hi, thanks!
Iām not sure if a suitable object-tracking algorithm working on stlite/Pyodide is available,
but this real-time image processing demo app with scikit-image image filters may be the starting point:
In this app, in addition to stlite, the real-time video I/O relies on streamlit-fesion custom component, which is still in beta though.
the only case when it does not is if I try to access the network from inside the stlite script .
Thatās interesting, as I thought network access from an stlite script is the same as normal JS network access such as fetch() or XMLHttpRequest.
It makes sense if <link> works and JS doesnāt, as the network access with <link> may include some credentials to access secured resources. If it is this case, adding the same cookie to the request header from stlite scripts (pyfetch()) could be a solution.
is there any way to read the file that was loaded in the html header from stlite
I think itās not possible.
A bonus question:
Makes sense, and the same approach using encodeB64ToArrayBuffer works for Python files for this purpose.
The discussion in the following issue may also help.
Hi, Iām a beginner at coding. I built a streamlit app and used PyInstaller to package my application into an .exe file. However, I ran into some issues while trying to open my exe file (main.exe). If I click on the .exe file, I get the following error: Session state does not function when running a script without streamlit run
When I try to run streamlit run main.exe on my terminal, it still doesnāt work, because streamlit run can only operate with .py files and not .exe files. I am using st.session_state to change the values and keys of my st.text_input at st.file_uploader.
I was referred to using st lite to resolve my issue, however Iām not too sure how st lite can replace st.session_state? Or is there a way I can somehow use .getElementByID() to change the value and keys of my st.text_input and st.file_uploader?
@kk09 Looks like itās mixture of different problems.
For the first problem, does your code work on normal Streamlit? I recommend you to ask it in a different thread as a general question.
For other questions, the answers are no.
I registered here just to give a massive thank you to Yuichiro @whitphx for creating stlite!
I use streamlit at work to test and create apps for risk management in geoscience and the possibility to make windows executables that my manager and coworkers can play with (without having to install python etc) is just great.
(a small aside: in my latest project I had to change st.segmented_control() to st.radio() otherwise the app wouldnt work⦠also tested st.pills() but it also failed⦠is there a list of streamlit components that are not āportedā to stlite yet?)