Skip to content

wasm-python wasm files to run python scripts in nodejs environments

License

Notifications You must be signed in to change notification settings

desktop-cgi/wasm-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wasm-python

wasm-python wasm files to run python scripts in nodejs environments

USAGE:

// hello_python.js
const { loadPyodide } = require("pyodide");
const path = require("path");

async function hello_python() {
  let pyodide = await loadPyodide({
    // indexURL: "<pyodide artifacts folder>",
    indexURL: path.join("./node_modules/pyodide"),
  });

  // RUN YOUR PYTHON CODE
  return pyodide.runPythonAsync("1+1");
}

hello_python().then((result) => {
  console.log("Python says that 1+1 =", result);
});

Demos can be found here in the demos folder

This is a direct port of npm package to run python using pyodide ported for desktop-cgi

Check out more on different ways of using Python language interpretor inside of JS, Node.js here https://pythondev.readthedocs.io/wasm.html

PYODIDE

About

wasm-python wasm files to run python scripts in nodejs environments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published