Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1 KB

README.md

File metadata and controls

33 lines (23 loc) · 1 KB

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