a function to fetch a python file and automatically fetch (relative import) used modules, (optional) run them once #1876
Replies: 3 comments 22 replies
-
I agree. Though we can fetch external files then execute it, people will simply want to For that, I think we may extend import system such as:
The main problem of this approach will be how to properly fetch external python files that are import candidates |
Beta Was this translation helpful? Give feedback.
-
I think it might not be a big deal for small or medium size of a group of Python files. But it indeed needs to do some time measurement for any new feature for module resolution/hook/hack. @ryanking13 Brython import system looks good. -- Let me explain more about the initial proposal.
|
Beta Was this translation helpful? Give feedback.
-
hi, I notice Python package management in the generated [tool.poetry]
name = "pyodide-helper"
packages = [
{ include = "abcd", from = "." }
] Then ref: https://github.com/python-poetry/poetry/pull/3257/files This simplifies the building wheel setup. |
Beta Was this translation helpful? Give feedback.
-
From my perspective, there are two applications of Pyodide, one is REPL, the other one is to load Python script(s) to run and it could be a small piece of a code or a larger codebase. I have migrated my Chrome extension to Pyodide base from pure JS, and been published. Thank you for this great tool. I may want to refactor my codes to multiple files and add more functionalities. It would be great if there is such a feature/API introduced in the title. With it, I do not need to fetch one by one Python files and run them.
Supporting the overall Python native import system may be a difficult/long-term task, and starting from "relative import" or even limit to the same folder might be easier. I'm not sure whether this approach is good or not.
Beta Was this translation helpful? Give feedback.
All reactions