Replies: 1 comment 6 replies
-
Hi, thank you for the message. I'm so glad to know such a passionate developer is using Stlite to create the wonderful works.
No, because, in the case of Stlite, Pyodide is working in a WebWorker so you can't access it directly from the JS main thread. This is also the reason why Stlite implemented its own methods such as
No, for now, unfortunately. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am a student from a university in Korea using Stlite for a project. I am creating a project with Google Blockly and Stlite.
This project allows users to code with blocks using Blockly, display the results with Stlite, and publish them as well (please refer to img01).
The goal of this project is to let users create their own machine learning models, similar to Google’s Teachable Machine, and combine them with Stlite to create interactive results, which can then be shared freely with others.
To the point:
I am trying to create a file tree for this project (please refer to img02).
I have implemented the handling of files uploaded to the file tree so they can be used inside Stlite’s Pyodide. However, I encountered a problem when trying to download the modified or preprocessed data back to the local environment, which led me to write this email.
In addition to this project, I am also working on another project where users can learn Python and machine learning by coding with blocks using Blockly and Pyodide on the web. This new project focuses on interactivity and publishing, which is why I am now using Stlite.
In the original project using Pyodide, I was able to create a file tree using Pyodide’s FS object, allowing me to upload files to Pyodide, download files from it, and modify files.
In the current project using Stlite, I don’t have access to the Pyodide object, so I have only been able to implement file uploading by using Stlite’s limited writeFile() method. However, I would like to implement file downloading as well, which is why I am reaching out for help.
Q1. Is there a way to access Pyodide’s FS object in Stlite?
Q2. If accessing FS is not possible, is there a way to handle downloading files from Pyodide to the local environment through the file tree, without writing Python code inside Stlite?
Lastly, I want to express my sincere gratitude as a user of Stlite working on this project.
(Please note that this email was written in Korean and translated into English using ChatGPT.)
Beta Was this translation helpful? Give feedback.
All reactions