-
Notifications
You must be signed in to change notification settings - Fork 14
Can wasmtime loads the python3.wasm in the process, and feed multiple python scripts in it? #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You have a couple of options. You could map a directory to where your files are then execute them as follows:
Another option would be to map a directory, then add that directory to your Python import path and import each one.
If you don't want to map directories, you can use wasi-vfs to embed the files into the Python Wasm file and use the above techniques. The second technique should work with |
It seems to be related to |
That option is mapping a local directory to a directory in the Wasm runtime so that the files can be accessed by Python. If you are using the latest version of this project, you don't even need this option anymore because the Python standard library is embedded in the Wasm file. You can add your own directory mappings using additional |
Thanks! |
Currently I can run a single python script on the wasm-compiled interpreter, e.g.
wasmtime run --mapdir=/opt/wasi-python/lib/python3.12::/opt/wasi-python/lib/python3.12 -- /opt/wasi-python/bin/python3.12.wasm -c "$(cat $(pwd)/test.py)"
. Is there a way to run multiple scripts with this (i.e. without loading the wasm-compiled interpreter multiple times)? Thanks!The text was updated successfully, but these errors were encountered: