Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/desktop-cgi/wasm-python

wasm-python wasm files to run python scripts in nodejs environments
https://github.com/desktop-cgi/wasm-python

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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: "",
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](https://github.com/desktop-cgi/wasm-python/tree/main/demos) folder

This is a direct port of [npm package to run python using pyodide](https://www.npmjs.com/package/pyodide) ported for [desktop-cgi](https://github.com/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](https://pythondev.readthedocs.io/wasm.html)

[PYODIDE](https://pyodide.org/en/stable/)