Issue
I'm trying to run PyScript in a webpage, where I intended it to run and produce the output of a python code to a div element. I've succeeded in doing this. However I noticed it always produces the splashscreen "Downloading Pyodide Python Startup" every time I refreshed the webpage. It's taking significantly longer wait time for this.
Is there a way to in a way cache the Pyodide installation and make the loading times significantly faster? I'm deploying this webpage to Github Pages here https://reza-nugraha32.github.io/geophysics-wiki/ .
I'm aware that it's not better to hide the splash screen entirely. Is there also a way to start this splash screen in a div container or importing the PyScript only when a "Run" button is clicked? For instance, Educative.io here made it so it display "Loading" only when the "Run" button is clicked.
I've tried deleting the defer
tag from the PyScript import script but it gave me errors.
Solution
Refer to the documentation: https://docs.pyscript.net/latest/reference/plugins/py-splashscreen.html
you can disable the splash screen using the following html code:
<py-config>
[splashscreen]
enabled = false
</py-config>
hope this helps!
Answered By - Rahul Madhusudan Nambiar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.