How can I make my own python file modules read by pyscript in a nested way? #1951
-
I have code that requires several nested dependencies imported into the same code. For you, community member, how can I make pyscript read code that has several dependencies?? Example:# ./Main.py
import arrr
from pyscript import document
import hello
def catch_argv(event):
hello.say_hello
catch_argv(event) # ./Hello.py
def say_hello():
print("Hello!") |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I took the freedom to edit your issue as it wasn't clear and it was using multi-line code within a single ` tick. To bring in modules you can use [files] which purpose is to load your files into the virtual FS automatically provided by this project. That allows you to import |
Beta Was this translation helpful? Give feedback.
-
Thank you really for helping me. |
Beta Was this translation helpful? Give feedback.
I took the freedom to edit your issue as it wasn't clear and it was using multi-line code within a single ` tick.
To bring in modules you can use [files] which purpose is to load your files into the virtual FS automatically provided by this project.
That allows you to import
hello
as long as you havehello.py
or anhello
folder with its__init__.py
in it, so that this issue is actually non-existent and, hopefully, well documented.