-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
In some systems this might be the Faq and the current faq might be a series of guides or recipes.
Anyway the section might look like this:
Task based Guide:
Where do I begin
- https://docs.pyscript.net/2025.3.1/user-guide/first-steps/
How do I configure pyscript to load packages, and local files
- https://docs.pyscript.net/2025.3.1/user-guide/configuration/
How do I setup my local machine for pyscript development
- https://www.pyscript.com/
- https://docs.pyscript.net/2025.3.1/faq/#packaging-pointers
I've got an unexpected error
- https://docs.pyscript.net/2025.3.1/faq/#common-errors
Dom Event code is not being called
- https://docs.pyscript.net/2025.3.1/user-guide/ffi/#create_proxy
- https://docs.pyscript.net/2025.3.1/faq/#common-errors
Using a javascript module from my python code
- https://docs.pyscript.net/2025.3.1/user-guide/dom/#working-with-javascript
Direct dom manipulations from python
- https://docs.pyscript.net/2025.3.1/user-guide/dom/#pyscriptweb
- https://docs.pyscript.net/2025.3.1/api/#pyscriptweb
- https://docs.pyscript.net/2025.3.1/api/#pyscriptwhen
Sending Javascript args from python to Javascript (and vice versa)
- https://docs.pyscript.net/2025.3.1/user-guide/ffi/
Converting Python entities into Javascript args
- https://docs.pyscript.net/2025.3.1/user-guide/ffi/
Saving and loading from the in-browser filesystem
- https://docs.pyscript.net/2025.3.1/user-guide/filesystem/#the-in-browser-filesystem
- https://docs.pyscript.net/2025.3.1/api/#pyscriptstorage
Saving and loading from the user's local filesystem (single or multiple)
- https://docs.pyscript.net/2025.3.1/user-guide/filesystem/#the-devices-local-filesystem
- https://docs.pyscript.net/2025.3.1/api/#pyscriptfs
Recipe for saving/loading a file to users file system
- https://docs.pyscript.net/2025.3.1/faq/#upload
Fetching data from a remote URL
- https://docs.pyscript.net/2025.3.1/api/#pyscriptfetch
Getting user input from the Terminal
- https://docs.pyscript.net/2025.3.1/user-guide/terminal/
- https://docs.pyscript.net/2025.3.1/user-guide/editor/
Getting user input from the Ltk UI toolkit
- https://pyscript.github.io/ltk/?tab=2&runtime=mpy
Adjusting Terminal parameters (size, clearing, colors, etc)
- https://docs.pyscript.net/2025.3.1/user-guide/terminal/#xterm-reference
Running code in an editor style interface
- https://docs.pyscript.net/2025.3.1/user-guide/editor/
Getting access to media devices like Camera and Sound
- https://docs.pyscript.net/2025.3.1/user-guide/media/
- https://docs.pyscript.net/2025.3.1/api/#pyscriptmedia
Making a PWA and installing offline
- https://pyscript.com/docs/pwa
How do I make Workers work for me
- https://docs.pyscript.net/2025.3.1/user-guide/workers/
- https://docs.pyscript.net/2025.3.1/api/#pyscriptcoredonkey
- https://docs.pyscript.net/2025.3.1/faq/#possible-deadlock
- https://docs.pyscript.net/2025.3.1/faq/#workers-via-javascript
How do I find events indicating when pyscript is loaded/done, etc
- https://docs.pyscript.net/2025.3.1/faq/#pyscript-events
Activity
WebReflection commentedon Apr 15, 2025
I really like this approach and wondering if @ntoll shares the same feeling
ntoll commentedon Apr 15, 2025
Yup. Working on it.
Neon22 commentedon Apr 28, 2025
More:
Your worker only runs once.
Neon22 commentedon May 9, 2025
For workers we now appear to have a number of choices - the use cases of which are not exactly clear:
Neon22 commentedon May 12, 2025
Also:
localStorage and sessionStorage are referred to as "Web Storage" and are disabled by some browsers(e.g. Firefox) when setting "disable third party cookies".
localstorage and Sessionstorage are synchronous and so the code waits for them to be accessed.
An async mechanism that performs the same objective and is not blocked by "third party cookie" settings is the "IndexedDB" storage. This is also available in Workers. Pyscript accesses this under pyscript.storage
It is documented for pyscript here: https://docs.pyscript.net/2025.3.1/api/#pyscriptstorage
This interface is synchronous and does async internally. (A write can be awaited).
Neon22 commentedon May 19, 2025
Can't emphasize this one enough:
Using fs.mount and system popup says: "Unable to grant access" and/or the Javascript console reports:
"Failed to execute 'showDirectoryPicker' on 'Window': Cross origin sub frames aren't allowed to show a file picker."
fs.mount()
filesystem storage in chrome from the editor page. It contains aniframe
and this operation is forbidden from within aniframe
. If you are on pyscript.com - click the "Visit Site" link to open the app on its own page.fs.mount
operation should then run.