Replies: 1 comment 2 replies
-
You can read the JS file and run it with import pathlib
js_code = pathlib.Path("path_to_the_js_file.js").read_text()
import pyodide.code
pyodide.code.run_js(js_code) Otherwise I think you could try something like this: https://stackoverflow.com/questions/57121467/import-a-module-from-string-variable |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a wheel that is built with Pyodide (in tree). Now I'd like the wheel's Python code to call some JavaScript functions via Pyodide's
js
module.Is there a way to include JavaScript files in a wheel? How would one load/import these?
For what it's worth, I'm using Pyodide as a Jupyter Lite kernel, so it runs in a web worker.
Beta Was this translation helpful? Give feedback.
All reactions